@@ -10,8 +10,12 @@ |
||
| 10 | 10 | }; |
| 11 | 11 | |
| 12 | 12 | // clean up |
| 13 | -if (file_exists($pharFile)) unlink($pharFile); |
|
| 14 | -if (file_exists($pharFile . '.gz')) unlink($pharFile . '.gz'); |
|
| 13 | +if (file_exists($pharFile)) { |
|
| 14 | + unlink($pharFile); |
|
| 15 | +} |
|
| 16 | +if (file_exists($pharFile . '.gz')) { |
|
| 17 | + unlink($pharFile . '.gz'); |
|
| 18 | +} |
|
| 15 | 19 | |
| 16 | 20 | try { |
| 17 | 21 | $phar = new Phar($pharFile); |
@@ -78,7 +78,9 @@ |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function setCode($code) { |
| 81 | - if (!\is_numeric($code)) throw new \InvalidArgumentException('expected numeric'); |
|
| 81 | + if (!\is_numeric($code)) { |
|
| 82 | + throw new \InvalidArgumentException('expected numeric'); |
|
| 83 | + } |
|
| 82 | 84 | $this->code = $code; |
| 83 | 85 | return $this; |
| 84 | 86 | } |
@@ -171,8 +171,12 @@ discard block |
||
| 171 | 171 | }); |
| 172 | 172 | |
| 173 | 173 | foreach ($paths as $path) { |
| 174 | - if (is_dir($path)) rmdir($path); |
|
| 175 | - if (is_file($path)) unlink($path); |
|
| 174 | + if (is_dir($path)) { |
|
| 175 | + rmdir($path); |
|
| 176 | + } |
|
| 177 | + if (is_file($path)) { |
|
| 178 | + unlink($path); |
|
| 179 | + } |
|
| 176 | 180 | } |
| 177 | 181 | |
| 178 | 182 | $payload->setType(Payload::STRUCTURE_CLEAN_SUCCESS); |
@@ -491,7 +495,9 @@ discard block |
||
| 491 | 495 | } |
| 492 | 496 | |
| 493 | 497 | foreach (array_reverse($releases) as $idx => $release) { |
| 494 | - if ($idx <= ($quantity - 1)) continue; |
|
| 498 | + if ($idx <= ($quantity - 1)) { |
|
| 499 | + continue; |
|
| 500 | + } |
|
| 495 | 501 | $proccess = new Process('rm -r ' . $release); |
| 496 | 502 | $proccess->run(); |
| 497 | 503 | } |
@@ -503,7 +509,9 @@ discard block |
||
| 503 | 509 | } |
| 504 | 510 | |
| 505 | 511 | public function absolutePath($path, $cwd) { |
| 506 | - if ($path[0] == '/') return $path; |
|
| 512 | + if ($path[0] == '/') { |
|
| 513 | + return $path; |
|
| 514 | + } |
|
| 507 | 515 | return $cwd . DIRECTORY_SEPARATOR . $path; |
| 508 | 516 | } |
| 509 | 517 | |