@@ -52,12 +52,12 @@ class Diff
52
52
/**
53
53
* @var array The "old" sequence to use as the basis for the comparison.
54
54
*/
55
- private $ a = null ;
55
+ private $ old = null ;
56
56
57
57
/**
58
58
* @var array The "new" sequence to generate the changes for.
59
59
*/
60
- private $ b = null ;
60
+ private $ new = null ;
61
61
62
62
/**
63
63
* @var array Array containing the generated op codes for the differences between the two items.
@@ -89,8 +89,8 @@ class Diff
89
89
*/
90
90
public function __construct (array $ a , array $ b , array $ options = array ())
91
91
{
92
- $ this ->a = $ a ;
93
- $ this ->b = $ b ;
92
+ $ this ->old = $ a ;
93
+ $ this ->new = $ b ;
94
94
95
95
if (is_array ($ options )) {
96
96
$ this ->options = array_merge ($ this ->defaultOptions , $ options );
@@ -122,10 +122,10 @@ public function render($renderer)
122
122
* @param int|null $end The ending number. If not supplied, only the item in $start will be returned.
123
123
* @return array Array of all of the lines between the specified range.
124
124
*/
125
- public function getA (int $ start = 0 , $ end = null ) : array
125
+ public function getOld (int $ start = 0 , $ end = null ) : array
126
126
{
127
127
if ($ start == 0 && $ end === null ) {
128
- return $ this ->a ;
128
+ return $ this ->old ;
129
129
}
130
130
131
131
if ($ end === null ) {
@@ -134,7 +134,7 @@ public function getA(int $start = 0, $end = null) : array
134
134
$ length = $ end - $ start ;
135
135
}
136
136
137
- return array_slice ($ this ->a , $ start , $ length );
137
+ return array_slice ($ this ->old , $ start , $ length );
138
138
}
139
139
140
140
/**
@@ -147,10 +147,10 @@ public function getA(int $start = 0, $end = null) : array
147
147
* @param int|null $end The ending number. If not supplied, only the item in $start will be returned.
148
148
* @return array Array of all of the lines between the specified range.
149
149
*/
150
- public function getB (int $ start = 0 , $ end = null ) : array
150
+ public function getNew (int $ start = 0 , $ end = null ) : array
151
151
{
152
152
if ($ start == 0 && $ end === null ) {
153
- return $ this ->b ;
153
+ return $ this ->new ;
154
154
}
155
155
156
156
if ($ end === null ) {
@@ -159,7 +159,7 @@ public function getB(int $start = 0, $end = null) : array
159
159
$ length = $ end - $ start ;
160
160
}
161
161
162
- return array_slice ($ this ->b , $ start , $ length );
162
+ return array_slice ($ this ->new , $ start , $ length );
163
163
}
164
164
165
165
/**
@@ -176,7 +176,7 @@ public function getGroupedOpcodes() : array
176
176
return $ this ->groupedCodes ;
177
177
}
178
178
179
- $ sequenceMatcher = new SequenceMatcher ($ this ->a , $ this ->b , $ this ->options , null );
179
+ $ sequenceMatcher = new SequenceMatcher ($ this ->old , $ this ->new , $ this ->options , null );
180
180
$ this ->groupedCodes = $ sequenceMatcher ->getGroupedOpcodes ($ this ->options ['context ' ]);
181
181
return $ this ->groupedCodes ;
182
182
}
0 commit comments