Completed
Pull Request — master (#7)
by Steve
03:26
created
src/RangeDifferencer/Core/LCS.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@
 block discarded – undo
62 62
         $max = min($length1, $length2);
63 63
 
64 64
         for ($forwardBound = 0;
65
-             $forwardBound < $max && $this->isRangeEqual($forwardBound, $forwardBound);
66
-             $forwardBound++) {
65
+                $forwardBound < $max && $this->isRangeEqual($forwardBound, $forwardBound);
66
+                $forwardBound++) {
67 67
             $this->setLcs($forwardBound, $forwardBound);
68 68
         }
69 69
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -162,14 +162,14 @@
 block discarded – undo
162 162
         $M = $topL2 - $bottomL2 + 1;
163 163
 
164 164
         $delta  = $N - $M;
165
-        $isEven = ($delta & 1) == 1? false : true;
165
+        $isEven = ($delta & 1) == 1 ? false : true;
166 166
 
167 167
         $limit = min($this->maxDifferences, intval(ceil(($N + $M + 1) / 2)));
168 168
 
169 169
         // Offset to make it odd/even.
170 170
         // a 0 or 1 that we add to the start offset to make it odd/even
171
-        $valueToAddForward  = ($M & 1) == 1? 1 : 0;
172
-        $valueToAddBackward = ($N & 1) == 1? 1 : 0;
171
+        $valueToAddForward  = ($M & 1) == 1 ? 1 : 0;
172
+        $valueToAddBackward = ($N & 1) == 1 ? 1 : 0;
173 173
 
174 174
         $startForward  = -$M;
175 175
         $endForward    = $N;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -253,8 +253,7 @@  discard block
 block discarded – undo
253 253
                 if ($x <= 0) {
254 254
                     $startBackward = $k + 1;
255 255
                     $valueToAddBackward = 0;
256
-                }
257
-                elseif ($y <= 0 && $endBackward > $k - 1) {
256
+                } elseif ($y <= 0 && $endBackward > $k - 1) {
258 257
                     $endBackward = $k - 1;
259 258
                 }
260 259
             }
@@ -324,8 +323,7 @@  discard block
 block discarded – undo
324 323
                 $maxProgress[0][0] = $x;
325 324
                 $maxProgress[0][1] = $y;
326 325
                 $maxProgress[0][2] = $progress;
327
-            }
328
-            elseif ($progress == $maxProgress[0][2]) {
326
+            } elseif ($progress == $maxProgress[0][2]) {
329 327
                 $numProgress++;
330 328
                 $maxProgress[$numProgress][0] = $x;
331 329
                 $maxProgress[$numProgress][1] = $y;
@@ -353,8 +351,7 @@  discard block
 block discarded – undo
353 351
                 $maxProgress[0][0] = $x;
354 352
                 $maxProgress[0][1] = $y;
355 353
                 $maxProgress[0][2] = $progress;
356
-            }
357
-            elseif ($progress == $maxProgress[0][2] && !$maxProgressForward) {
354
+            } elseif ($progress == $maxProgress[0][2] && !$maxProgressForward) {
358 355
                 $numProgress++;
359 356
                 $maxProgress[$numProgress][0] = $x;
360 357
                 $maxProgress[$numProgress][1] = $y;
Please login to merge, or discard this patch.
src/RangeDifferencer/RangeDifference.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -282,12 +282,12 @@
 block discarded – undo
282 282
     public function equals(RangeDifference $other): bool
283 283
     {
284 284
         return
285
-            $this->kind           === $other->getKind() &&
286
-            $this->leftStart      === $other->getLeftStart() &&
287
-            $this->leftLength     === $other->getLeftLength() &&
288
-            $this->rightStart     === $other->getRightStart() &&
289
-            $this->rightLength    === $other->getRightLength() &&
290
-            $this->ancestorStart  === $other->getAncestorStart() &&
285
+            $this->kind === $other->getKind() &&
286
+            $this->leftStart === $other->getLeftStart() &&
287
+            $this->leftLength === $other->getLeftLength() &&
288
+            $this->rightStart === $other->getRightStart() &&
289
+            $this->rightLength === $other->getRightLength() &&
290
+            $this->ancestorStart === $other->getAncestorStart() &&
291 291
             $this->ancestorLength === $other->getAncestorLength();
292 292
     }
293 293
 
Please login to merge, or discard this patch.