Skip to content

Commit 516c4be

Browse files
author
Chris Boulton
committed
Add missing docblock. Rename isLineDifferent to linesAreDifferent
1 parent 2c38d0e commit 516c4be

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

lib/Diff/Renderer/Html/Array.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function render()
146146
* @param string $toLine The second string.
147147
* @return array Array containing the starting position (0 by default) and the ending position (-1 by default)
148148
*/
149-
private function GetChangeExtent($fromLine, $toLine)
149+
private function getChangeExtent($fromLine, $toLine)
150150
{
151151
$start = 0;
152152
$limit = min(strlen($fromLine), strlen($toLine));

lib/Diff/SequenceMatcher.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ public function findLongestMatch($alo, $ahi, $blo, $bhi)
273273
}
274274

275275
while($bestI > $alo && $bestJ > $blo && !$this->isBJunk($b[$bestJ - 1]) &&
276-
!$this->isLineDifferent($bestI - 1, $bestJ - 1)) {
276+
!$this->linesAreDifferent($bestI - 1, $bestJ - 1)) {
277277
--$bestI;
278278
--$bestJ;
279279
++$bestSize;
280280
}
281281

282282
while($bestI + $bestSize < $ahi && ($bestJ + $bestSize) < $bhi &&
283-
!$this->isBJunk($b[$bestJ + $bestSize]) && !$this->isLineDifferent($bestI + $bestSize, $bestJ + $bestSize)) {
283+
!$this->isBJunk($b[$bestJ + $bestSize]) && !$this->linesAreDifferent($bestI + $bestSize, $bestJ + $bestSize)) {
284284
++$bestSize;
285285
}
286286

@@ -292,7 +292,7 @@ public function findLongestMatch($alo, $ahi, $blo, $bhi)
292292
}
293293

294294
while($bestI + $bestSize < $ahi && $bestJ + $bestSize < $bhi &&
295-
$this->isBJunk($b[$bestJ + $bestSize]) && !$this->isLineDifferent($bestI + $bestSize, $bestJ + $bestSize)) {
295+
$this->isBJunk($b[$bestJ + $bestSize]) && !$this->linesAreDifferent($bestI + $bestSize, $bestJ + $bestSize)) {
296296
++$bestSize;
297297
}
298298

@@ -303,7 +303,14 @@ public function findLongestMatch($alo, $ahi, $blo, $bhi)
303303
);
304304
}
305305

306-
public function isLineDifferent($aIndex, $bIndex)
306+
/**
307+
* Check if the two lines at the given indexes are different or not.
308+
*
309+
* @param int $aIndex Line number to check against in a.
310+
* @param int $bIndex Line number to check against in b.
311+
* @return boolean True if the lines are different and false if not.
312+
*/
313+
public function linesAreDifferent($aIndex, $bIndex)
307314
{
308315
$lineA = $this->a[$aIndex];
309316
$lineB = $this->b[$bIndex];

0 commit comments

Comments
 (0)