@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $path = $this->absolutePath($path, getcwd()); |
| 89 | - $messages = []; |
|
| 89 | + $messages = [ ]; |
|
| 90 | 90 | |
| 91 | 91 | if (!is_dir($path)) { |
| 92 | 92 | if (mkdir($path, 0777, true)) { |
| 93 | - $messages[] = 'directory "' . realpath($path) . '" created'; |
|
| 93 | + $messages[ ] = 'directory "' . realpath($path) . '" created'; |
|
| 94 | 94 | } else { |
| 95 | 95 | $payload->setType(Payload::STRUCTURE_REPAIR_FAIL); |
| 96 | 96 | $payload->setMessage('directory "' . $path . '" does not created'); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $releasesDir = $path . DIRECTORY_SEPARATOR . 'releases'; |
| 103 | 103 | if (!is_dir($releasesDir)) { |
| 104 | 104 | if (mkdir($releasesDir, 0777, true)) { |
| 105 | - $messages[] = 'directory "' . realpath($releasesDir) . '" created'; |
|
| 105 | + $messages[ ] = 'directory "' . realpath($releasesDir) . '" created'; |
|
| 106 | 106 | } else { |
| 107 | 107 | $payload->setType(Payload::STRUCTURE_REPAIR_FAIL); |
| 108 | 108 | $payload->setMessage('directory "' . $releasesDir . '" does not created'); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $sharedDir = $path . DIRECTORY_SEPARATOR . 'shared'; |
| 115 | 115 | if (!is_dir($sharedDir)) { |
| 116 | 116 | if (mkdir($sharedDir, 0777, true)) { |
| 117 | - $messages[] = 'directory "' . realpath($sharedDir) . '" created'; |
|
| 117 | + $messages[ ] = 'directory "' . realpath($sharedDir) . '" created'; |
|
| 118 | 118 | } else { |
| 119 | 119 | $payload->setType(Payload::STRUCTURE_REPAIR_FAIL); |
| 120 | 120 | $payload->setMessage('directory "' . $sharedDir . '" does not created'); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $logFile = $path . DIRECTORY_SEPARATOR . 'deploid.log'; |
| 127 | 127 | if (!is_file($logFile)) { |
| 128 | 128 | if (touch($logFile)) { |
| 129 | - $messages[] = 'file "' . realpath($logFile) . '" created'; |
|
| 129 | + $messages[ ] = 'file "' . realpath($logFile) . '" created'; |
|
| 130 | 130 | } else { |
| 131 | 131 | $payload->setType(Payload::STRUCTURE_REPAIR_FAIL); |
| 132 | 132 | $payload->setMessage('file"' . $logFile . '" does not created'); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | 'deploid.log', |
| 167 | 167 | ]; |
| 168 | 168 | |
| 169 | - $paths = array_filter($paths, function ($path) use ($needed) { |
|
| 169 | + $paths = array_filter($paths, function($path) use ($needed) { |
|
| 170 | 170 | return !in_array(basename($path), $needed); |
| 171 | 171 | }); |
| 172 | 172 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | $payload->setType(Payload::STRUCTURE_CLEAN_SUCCESS); |
| 179 | - $payload->setMessage(array_merge(['cleaned items:'], $paths)); |
|
| 179 | + $payload->setMessage(array_merge([ 'cleaned items:' ], $paths)); |
|
| 180 | 180 | $payload->setCode(0); |
| 181 | 181 | return $payload; |
| 182 | 182 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | return $payload; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - $dirs = array_map(function ($path) { |
|
| 326 | + $dirs = array_map(function($path) { |
|
| 327 | 327 | return basename($path); |
| 328 | 328 | }, $dirs); |
| 329 | 329 | |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | return $payload; |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - $dirs = array_map(function ($path) { |
|
| 361 | + $dirs = array_map(function($path) { |
|
| 362 | 362 | return basename($path); |
| 363 | 363 | }, $dirs); |
| 364 | 364 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | public function absolutePath($path, $cwd) { |
| 506 | - if ($path[0] == '/') return $path; |
|
| 506 | + if ($path[ 0 ] == '/') return $path; |
|
| 507 | 507 | return $cwd . DIRECTORY_SEPARATOR . $path; |
| 508 | 508 | } |
| 509 | 509 | |