@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $baseLines = Line::createArray( |
66 | 66 | array_map( |
67 | - function ($l) { |
|
67 | + function($l) { |
|
68 | 68 | return [$l, 0]; |
69 | 69 | }, |
70 | 70 | explode("\n", $base) |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $i = -1; |
113 | 113 | |
114 | 114 | // Loop over all indexes of the base and all hunks. |
115 | - while ($i < count($base) || $a->valid() || $b->valid()) { |
|
115 | + while ($i < count($base) || $a->valid() || $b->valid()) { |
|
116 | 116 | // Assure that $aa is the first hunk by swaping $a and $b |
117 | 117 | if ($a->valid() && $b->valid() && $a->current()->getStart() > $b->current()->getStart()) { |
118 | 118 | self::swap($a, $b, $flipped); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $a->next(); |
161 | 161 | } else { |
162 | 162 | // Not dealing with a change, so return the line from the base. |
163 | - if ($i>=0) { |
|
163 | + if ($i >= 0) { |
|
164 | 164 | $merged[] = $base[$i]->getContent(); |
165 | 165 | } |
166 | 166 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $this->start = $start; |
64 | 64 | if ($end === null) { |
65 | - $end= $start; |
|
65 | + $end = $start; |
|
66 | 66 | } |
67 | 67 | $this->end = $end; |
68 | 68 | if (!is_array($lines)) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | { |
203 | 203 | return array_values(array_filter( |
204 | 204 | $this->lines, |
205 | - function (Line $line) { |
|
205 | + function(Line $line) { |
|
206 | 206 | return $line->getType() == Line::REMOVED; |
207 | 207 | } |
208 | 208 | )); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | { |
218 | 218 | return array_values(array_filter( |
219 | 219 | $this->lines, |
220 | - function (Line $line) { |
|
220 | + function(Line $line) { |
|
221 | 221 | return $line->getType() == Line::ADDED; |
222 | 222 | } |
223 | 223 | )); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | public function getLinesContent() |
232 | 232 | { |
233 | 233 | return array_map( |
234 | - function (Line $line) { |
|
234 | + function(Line $line) { |
|
235 | 235 | return $line->getContent(); |
236 | 236 | }, |
237 | 237 | $this->getAddedLines() |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
293 | - * @param $text |
|
293 | + * @param string $text |
|
294 | 294 | * @return string |
295 | 295 | */ |
296 | 296 | protected static function preMergeAlter($text) : string |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
303 | - * @param $text |
|
303 | + * @param string $text |
|
304 | 304 | * @return bool|string |
305 | 305 | */ |
306 | 306 | protected static function postMergeAlter($text) : string |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | protected static function preMergeAlter($text) : string |
297 | 297 | { |
298 | 298 | // Append new lines so that conflicts at the end of the text work. |
299 | - return $text . "\nthe\nend"; |
|
299 | + return $text."\nthe\nend"; |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -333,11 +333,11 @@ discard block |
||
333 | 333 | if (!$this->dir) { |
334 | 334 | // Greate a temporary directory. |
335 | 335 | $tempfile = tempnam(sys_get_temp_dir(), ''); |
336 | - mkdir($tempfile . '.git'); |
|
336 | + mkdir($tempfile.'.git'); |
|
337 | 337 | if (file_exists($tempfile)) { |
338 | 338 | unlink($tempfile); |
339 | 339 | } |
340 | - $this->dir = $tempfile . '.git'; |
|
340 | + $this->dir = $tempfile.'.git'; |
|
341 | 341 | $this->git = $this->wrapper->init($this->dir); |
342 | 342 | } |
343 | 343 | $this->git->config('user.name', 'GitMerge') |