Skip to content

Commit 0a7fff5

Browse files
committed
avoid short variable names
1 parent 8037d99 commit 0a7fff5

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

lib/jblond/Diff/SequenceMatcher.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ class SequenceMatcher
5353
/**
5454
* @var array The first sequence to compare against.
5555
*/
56-
private $a = array();
56+
private $old = array();
5757

5858
/**
5959
* @var array The second sequence.
6060
*/
61-
private $b = array();
61+
private $new = array();
6262

6363
/**
6464
* @var array Array of characters that are considered junk from the second sequence. Characters are the array key.
@@ -112,8 +112,8 @@ class SequenceMatcher
112112
*/
113113
public function __construct($a, $b, array $options, $junkCallback = null)
114114
{
115-
$this->a = array();
116-
$this->b = array();
115+
$this->old = array();
116+
$this->new = array();
117117
$this->junkCallback = $junkCallback;
118118
$this->setOptions($options);
119119
$this->setSequences($a, $b);
@@ -150,11 +150,11 @@ public function setSeq1($partA)
150150
if (!is_array($partA)) {
151151
$partA = str_split($partA);
152152
}
153-
if ($partA == $this->a) {
153+
if ($partA == $this->old) {
154154
return;
155155
}
156156

157-
$this->a = $partA;
157+
$this->old = $partA;
158158
$this->matchingBlocks = null;
159159
$this->opCodes = null;
160160
}
@@ -170,11 +170,11 @@ public function setSeq2($partB)
170170
if (!is_array($partB)) {
171171
$partB = str_split($partB);
172172
}
173-
if ($partB == $this->b) {
173+
if ($partB == $this->new) {
174174
return;
175175
}
176176

177-
$this->b = $partB;
177+
$this->new = $partB;
178178
$this->matchingBlocks = null;
179179
$this->opCodes = null;
180180
$this->fullBCount = null;
@@ -187,12 +187,12 @@ public function setSeq2($partB)
187187
*/
188188
private function chainB()
189189
{
190-
$length = count($this->b);
190+
$length = count($this->new);
191191
$this->b2j = array();
192192
$popularDict = array();
193193

194194
for ($i = 0; $i < $length; ++$i) {
195-
$char = $this->b[$i];
195+
$char = $this->new[$i];
196196
if (isset($this->b2j[$char])) {
197197
if ($length >= 200 && count($this->b2j[$char]) * 100 > $length) {
198198
$popularDict[$char] = 1;
@@ -268,8 +268,8 @@ private function isBJunk(string $b) : bool
268268
*/
269269
public function findLongestMatch(int $alo, int $ahi, int $blo, int $bhi) : array
270270
{
271-
$a = $this->a;
272-
$b = $this->b;
271+
$a = $this->old;
272+
$b = $this->new;
273273

274274
$bestI = $alo;
275275
$bestJ = $blo;
@@ -351,8 +351,8 @@ public function findLongestMatch(int $alo, int $ahi, int $blo, int $bhi) : array
351351
*/
352352
public function linesAreDifferent(int $aIndex, int $bIndex) : bool
353353
{
354-
$lineA = $this->a[$aIndex];
355-
$lineB = $this->b[$bIndex];
354+
$lineA = $this->old[$aIndex];
355+
$lineB = $this->new[$bIndex];
356356

357357
if ($this->options['ignoreWhitespace']) {
358358
$replace = array("\t", ' ');
@@ -388,8 +388,8 @@ public function getMatchingBlocks() : array
388388
return $this->matchingBlocks;
389389
}
390390

391-
$aLength = count($this->a);
392-
$bLength = count($this->b);
391+
$aLength = count($this->old);
392+
$bLength = count($this->new);
393393

394394
$queue = array(
395395
array(
@@ -642,7 +642,7 @@ public function getGroupedOpcodes(int $context = 3) : array
642642
public function ratio() : float
643643
{
644644
$matches = array_reduce($this->getMatchingBlocks(), function($sum, $triple){ return $this->ratioReduce($sum, $triple); }, 0);
645-
return $this->calculateRatio($matches, count($this->a) + count($this->b));
645+
return $this->calculateRatio($matches, count($this->old) + count($this->new));
646646
}
647647

648648
/**

0 commit comments

Comments
 (0)