@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $sequence2 = $string2; |
| 44 | 44 | $end1 = strlen($string1) - 1; |
| 45 | 45 | $end2 = strlen($string2) - 1; |
| 46 | - }else{ |
|
| 46 | + } else{ |
|
| 47 | 47 | $sequence1 = preg_split('/\R/', $string1); |
| 48 | 48 | $sequence2 = preg_split('/\R/', $string2); |
| 49 | 49 | $end1 = count($sequence1) - 1; |
@@ -75,7 +75,9 @@ discard block |
||
| 75 | 75 | for ($index = 0; $index < $start; $index ++){ |
| 76 | 76 | $diff[] = array($sequence1[$index], self::UNMODIFIED); |
| 77 | 77 | } |
| 78 | - while (count($partialDiff) > 0) $diff[] = array_pop($partialDiff); |
|
| 78 | + while (count($partialDiff) > 0) { |
|
| 79 | + $diff[] = array_pop($partialDiff); |
|
| 80 | + } |
|
| 79 | 81 | for ($index = $end1 + 1; |
| 80 | 82 | $index < ($compareCharacters ? strlen($sequence1) : count($sequence1)); |
| 81 | 83 | $index ++){ |
@@ -137,7 +139,7 @@ discard block |
||
| 137 | 139 | if ($sequence1[$index1 + $start - 1] |
| 138 | 140 | == $sequence2[$index2 + $start - 1]){ |
| 139 | 141 | $table[$index1][$index2] = $table[$index1 - 1][$index2 - 1] + 1; |
| 140 | - }else{ |
|
| 142 | + } else{ |
|
| 141 | 143 | $table[$index1][$index2] = |
| 142 | 144 | max($table[$index1 - 1][$index2], $table[$index1][$index2 - 1]); |
| 143 | 145 | } |
@@ -181,14 +183,14 @@ discard block |
||
| 181 | 183 | $index1 --; |
| 182 | 184 | $index2 --; |
| 183 | 185 | |
| 184 | - }elseif ($index2 > 0 |
|
| 186 | + } elseif ($index2 > 0 |
|
| 185 | 187 | && $table[$index1][$index2] == $table[$index1][$index2 - 1]){ |
| 186 | 188 | |
| 187 | 189 | // update the diff and the indices |
| 188 | 190 | $diff[] = array($sequence2[$index2 + $start - 1], self::INSERTED); |
| 189 | 191 | $index2 --; |
| 190 | 192 | |
| 191 | - }else{ |
|
| 193 | + } else{ |
|
| 192 | 194 | |
| 193 | 195 | // update the diff and the indices |
| 194 | 196 | $diff[] = array($sequence1[$index1 + $start - 1], self::DELETED); |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); |
| 6 | 6 | $absolutes = []; |
| 7 | 7 | foreach ($parts as $part) { |
| 8 | - if ('.' == $part) continue; |
|
| 8 | + if ('.' == $part) { |
|
| 9 | + continue; |
|
| 10 | + } |
|
| 9 | 11 | if ('..' == $part) { |
| 10 | 12 | array_pop($absolutes); |
| 11 | 13 | } else { |