@@ -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 | } |
@@ -188,8 +188,7 @@ discard block |
||
188 | 188 | $this->sequence2 = $this->string2; |
189 | 189 | $end1 = strlen($this->string1) - 1; |
190 | 190 | $end2 = strlen($this->string2) - 1; |
191 | - } |
|
192 | - else |
|
191 | + } else |
|
193 | 192 | { |
194 | 193 | $this->sequence1 = preg_split('/\R/', $this->string1); |
195 | 194 | $this->sequence2 = preg_split('/\R/', $this->string2); |
@@ -273,7 +272,7 @@ discard block |
||
273 | 272 | if ($this->sequence1[$index1 + $start - 1] |
274 | 273 | == $this->sequence2[$index2 + $start - 1]){ |
275 | 274 | $table[$index1][$index2] = $table[$index1 - 1][$index2 - 1] + 1; |
276 | - }else{ |
|
275 | + } else{ |
|
277 | 276 | $table[$index1][$index2] = |
278 | 277 | max($table[$index1 - 1][$index2], $table[$index1][$index2 - 1]); |
279 | 278 | } |
@@ -313,16 +312,14 @@ discard block |
||
313 | 312 | $diff[] = array($this->sequence1[$index1 + $start - 1], self::UNMODIFIED); |
314 | 313 | $index1 --; |
315 | 314 | $index2 --; |
316 | - } |
|
317 | - elseif ( |
|
315 | + } elseif ( |
|
318 | 316 | $index2 > 0 |
319 | 317 | && $table[$index1][$index2] == $table[$index1][$index2 - 1] |
320 | 318 | ) { |
321 | 319 | // update the diff and the indices |
322 | 320 | $diff[] = array($this->sequence2[$index2 + $start - 1], self::INSERTED); |
323 | 321 | $index2 --; |
324 | - } |
|
325 | - else |
|
322 | + } else |
|
326 | 323 | { |
327 | 324 | // update the diff and the indices |
328 | 325 | $diff[] = array($this->sequence1[$index1 + $start - 1], self::DELETED); |