@@ -104,19 +104,19 @@ class SequenceMatcher
104
104
* sequence matcher and it will perform a basic cleanup & calculate junk
105
105
* elements.
106
106
*
107
- * @param string|array $a A string or array containing the lines to compare against.
108
- * @param string|array $b A string or array containing the lines to compare.
107
+ * @param string|array $old A string or array containing the lines to compare against.
108
+ * @param string|array $new A string or array containing the lines to compare.
109
109
* @param array $options
110
110
* @param string|array|null $junkCallback Either an array or string that references a callback function
111
111
* (if there is one) to determine 'junk' characters.
112
112
*/
113
- public function __construct ($ a , $ b , array $ options , $ junkCallback = null )
113
+ public function __construct ($ old , $ new , array $ options , $ junkCallback = null )
114
114
{
115
115
$ this ->old = array ();
116
116
$ this ->new = array ();
117
117
$ this ->junkCallback = $ junkCallback ;
118
118
$ this ->setOptions ($ options );
119
- $ this ->setSequences ($ a , $ b );
119
+ $ this ->setSequences ($ old , $ new );
120
120
}
121
121
122
122
/**
@@ -234,12 +234,12 @@ private function chainB()
234
234
* Checks if a particular character is in the junk dictionary
235
235
* for the list of junk characters.
236
236
*
237
- * @param string $b
237
+ * @param string $bString
238
238
* @return bool $b True if the character is considered junk. False if not.
239
239
*/
240
- private function isBJunk (string $ b ) : bool
240
+ private function isBJunk (string $ bString ) : bool
241
241
{
242
- if (isset ($ this ->junkDict [$ b ])) {
242
+ if (isset ($ this ->junkDict [$ bString ])) {
243
243
return true ;
244
244
}
245
245
@@ -427,7 +427,7 @@ public function getMatchingBlocks() : array
427
427
}
428
428
}
429
429
430
- usort ($ matchingBlocks , array ( $ this , ' tupleSort ' ) );
430
+ usort ($ matchingBlocks , function ( $ aArray , $ bArray ) { return $ this -> tupleSort ( $ aArray , $ bArray ); } );
431
431
432
432
$ i1 = 0 ;
433
433
$ j1 = 0 ;
@@ -694,25 +694,25 @@ private function arrayGetDefault(array $array, $key, $default)
694
694
/**
695
695
* Sort an array by the nested arrays it contains. Helper function for getMatchingBlocks
696
696
*
697
- * @param array $a First array to compare.
698
- * @param array $b Second array to compare.
697
+ * @param array $aArray First array to compare.
698
+ * @param array $bArray Second array to compare.
699
699
* @return int -1, 0 or 1, as expected by the usort function.
700
700
*/
701
- private function tupleSort (array $ a , array $ b ) : int
701
+ private function tupleSort (array $ aArray , array $ bArray ) : int
702
702
{
703
- $ max = max (count ($ a ), count ($ b ));
703
+ $ max = max (count ($ aArray ), count ($ bArray ));
704
704
for ($ counter = 0 ; $ counter < $ max ; ++$ counter ) {
705
- if ($ a [$ counter ] < $ b [$ counter ]) {
705
+ if ($ aArray [$ counter ] < $ bArray [$ counter ]) {
706
706
return -1 ;
707
- } elseif ($ a [$ counter ] > $ b [$ counter ]) {
707
+ } elseif ($ aArray [$ counter ] > $ bArray [$ counter ]) {
708
708
return 1 ;
709
709
}
710
710
}
711
711
712
- if (count ($ a ) == count ($ b )) {
712
+ if (count ($ aArray ) == count ($ bArray )) {
713
713
return 0 ;
714
714
}
715
- if (count ($ a ) < count ($ b )) {
715
+ if (count ($ aArray ) < count ($ bArray )) {
716
716
return -1 ;
717
717
}
718
718
return 1 ;
0 commit comments