@@ -164,9 +164,7 @@ discard block |
||
164 | 164 | if(empty($leftCell)) |
165 | 165 | { |
166 | 166 | return 'empty'; |
167 | - } |
|
168 | - |
|
169 | - else if($leftCell !== $rightCell) |
|
167 | + } else if($leftCell !== $rightCell) |
|
170 | 168 | { |
171 | 169 | return 'del'; |
172 | 170 | } |
@@ -179,9 +177,7 @@ discard block |
||
179 | 177 | if(empty($rightCell)) |
180 | 178 | { |
181 | 179 | return 'empty'; |
182 | - } |
|
183 | - |
|
184 | - else if($leftCell !== $rightCell) |
|
180 | + } else if($leftCell !== $rightCell) |
|
185 | 181 | { |
186 | 182 | return 'ins'; |
187 | 183 | } |
@@ -189,8 +189,7 @@ discard block |
||
189 | 189 | $this->sequence2 = $this->string2; |
190 | 190 | $end1 = strlen($this->string1) - 1; |
191 | 191 | $end2 = strlen($this->string2) - 1; |
192 | - } |
|
193 | - else |
|
192 | + } else |
|
194 | 193 | { |
195 | 194 | $this->sequence1 = $this->splitString($this->string1); |
196 | 195 | $this->sequence2 = $this->splitString($this->string2); |
@@ -297,7 +296,7 @@ discard block |
||
297 | 296 | if ($this->sequence1[$index1 + $start - 1] |
298 | 297 | == $this->sequence2[$index2 + $start - 1]){ |
299 | 298 | $table[$index1][$index2] = $table[$index1 - 1][$index2 - 1] + 1; |
300 | - }else{ |
|
299 | + } else{ |
|
301 | 300 | $table[$index1][$index2] = |
302 | 301 | max($table[$index1 - 1][$index2], $table[$index1][$index2 - 1]); |
303 | 302 | } |
@@ -337,16 +336,14 @@ discard block |
||
337 | 336 | $diff[] = array($this->sequence1[$index1 + $start - 1], self::UNMODIFIED); |
338 | 337 | $index1 --; |
339 | 338 | $index2 --; |
340 | - } |
|
341 | - elseif ( |
|
339 | + } elseif ( |
|
342 | 340 | $index2 > 0 |
343 | 341 | && $table[$index1][$index2] == $table[$index1][$index2 - 1] |
344 | 342 | ) { |
345 | 343 | // update the diff and the indices |
346 | 344 | $diff[] = array($this->sequence2[$index2 + $start - 1], self::INSERTED); |
347 | 345 | $index2 --; |
348 | - } |
|
349 | - else |
|
346 | + } else |
|
350 | 347 | { |
351 | 348 | // update the diff and the indices |
352 | 349 | $diff[] = array($this->sequence1[$index1 + $start - 1], self::DELETED); |