@@ -112,11 +112,11 @@ public function renderHtml($changes, $object)
112
112
*/
113
113
public function render ()
114
114
{
115
- // As we'll be modifying a & b to include our change markers,
115
+ // As we'll be modifying old & new to include our change markers,
116
116
// we need to get the contents and store them here. That way
117
117
// we're not going to destroy the original data
118
- $ a = $ this ->diff ->getOld ();
119
- $ b = $ this ->diff ->getNew ();
118
+ $ old = $ this ->diff ->getOld ();
119
+ $ new = $ this ->diff ->getNew ();
120
120
121
121
$ changes = array ();
122
122
$ opCodes = $ this ->diff ->getGroupedOpcodes ();
@@ -129,8 +129,8 @@ public function render()
129
129
130
130
if ($ tag == 'replace ' && $ i2 - $ i1 == $ j2 - $ j1 ) {
131
131
for ($ i = 0 ; $ i < ($ i2 - $ i1 ); ++$ i ) {
132
- $ fromLine = $ a [$ i1 + $ i ];
133
- $ toLine = $ b [$ j1 + $ i ];
132
+ $ fromLine = $ old [$ i1 + $ i ];
133
+ $ toLine = $ new [$ j1 + $ i ];
134
134
135
135
list ($ start , $ end ) = $ this ->getChangeExtent ($ fromLine , $ toLine );
136
136
if ($ start != 0 || $ end != 0 ) {
@@ -145,8 +145,8 @@ public function render()
145
145
"\0" . mb_substr ($ toLine , $ start , $ realEnd - $ start ) . "\1" .
146
146
mb_substr ($ toLine , $ realEnd );
147
147
148
- $ a [$ i1 + $ i ] = $ fromLine ;
149
- $ b [$ j1 + $ i ] = $ toLine ;
148
+ $ old [$ i1 + $ i ] = $ fromLine ;
149
+ $ new [$ j1 + $ i ] = $ toLine ;
150
150
}
151
151
}
152
152
}
@@ -159,20 +159,20 @@ public function render()
159
159
$ lastTag = $ tag ;
160
160
161
161
if ($ tag == 'equal ' ) {
162
- $ lines = array_slice ($ a , $ i1 , ($ i2 - $ i1 ));
162
+ $ lines = array_slice ($ old , $ i1 , ($ i2 - $ i1 ));
163
163
$ blocks [$ lastBlock ]['base ' ]['lines ' ] += $ this ->formatLines ($ lines );
164
- $ lines = array_slice ($ b , $ j1 , ($ j2 - $ j1 ));
164
+ $ lines = array_slice ($ new , $ j1 , ($ j2 - $ j1 ));
165
165
$ blocks [$ lastBlock ]['changed ' ]['lines ' ] += $ this ->formatLines ($ lines );
166
166
} else {
167
167
if ($ tag == 'replace ' || $ tag == 'delete ' ) {
168
- $ lines = array_slice ($ a , $ i1 , ($ i2 - $ i1 ));
168
+ $ lines = array_slice ($ old , $ i1 , ($ i2 - $ i1 ));
169
169
$ lines = $ this ->formatLines ($ lines );
170
170
$ lines = str_replace (array ("\0" , "\1" ), array ('<del> ' , '</del> ' ), $ lines );
171
171
$ blocks [$ lastBlock ]['base ' ]['lines ' ] += $ lines ;
172
172
}
173
173
174
174
if ($ tag == 'replace ' || $ tag == 'insert ' ) {
175
- $ lines = array_slice ($ b , $ j1 , ($ j2 - $ j1 ));
175
+ $ lines = array_slice ($ new , $ j1 , ($ j2 - $ j1 ));
176
176
$ lines = $ this ->formatLines ($ lines );
177
177
$ lines = str_replace (array ("\0" , "\1" ), array ('<ins> ' , '</ins> ' ), $ lines );
178
178
$ blocks [$ lastBlock ]['changed ' ]['lines ' ] += $ lines ;
0 commit comments