@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | foreach ($items as $item) { |
| 72 | 72 | if ($section == 'dirs' && strlen($item)) mkdir($path . DIRECTORY_SEPARATOR . $item, 0777, true); |
| 73 | 73 | if ($section == 'files' && strlen($item)) touch($path . DIRECTORY_SEPARATOR . $item); |
| 74 | - if ($section == 'links' && strlen($item)) symlink($path . DIRECTORY_SEPARATOR . (explode(':', $item)[1]), $path . DIRECTORY_SEPARATOR . (explode(':', $item)[0])); |
|
| 74 | + if ($section == 'links' && strlen($item)) symlink($path . DIRECTORY_SEPARATOR . (explode(':', $item)[ 1 ]), $path . DIRECTORY_SEPARATOR . (explode(':', $item)[ 0 ])); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $path = $this->absolutePath($path, getcwd()); |
| 137 | - $messages = []; |
|
| 137 | + $messages = [ ]; |
|
| 138 | 138 | |
| 139 | 139 | if (!is_dir($path)) { |
| 140 | 140 | if (mkdir($path, 0777, true)) { |
| 141 | - $messages[] = 'directory "' . realpath($path) . '" created'; |
|
| 141 | + $messages[ ] = 'directory "' . realpath($path) . '" created'; |
|
| 142 | 142 | } else { |
| 143 | 143 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 144 | 144 | $payload->setMessage('directory "' . $path . '" does not created'); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $releasesDir = $path . DIRECTORY_SEPARATOR . 'releases'; |
| 151 | 151 | if (!is_dir($releasesDir)) { |
| 152 | 152 | if (mkdir($releasesDir, 0777, true)) { |
| 153 | - $messages[] = 'directory "' . realpath($releasesDir) . '" created'; |
|
| 153 | + $messages[ ] = 'directory "' . realpath($releasesDir) . '" created'; |
|
| 154 | 154 | } else { |
| 155 | 155 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 156 | 156 | $payload->setMessage('directory "' . $releasesDir . '" does not created'); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $sharedDir = $path . DIRECTORY_SEPARATOR . 'shared'; |
| 163 | 163 | if (!is_dir($sharedDir)) { |
| 164 | 164 | if (mkdir($sharedDir, 0777, true)) { |
| 165 | - $messages[] = 'directory "' . realpath($sharedDir) . '" created'; |
|
| 165 | + $messages[ ] = 'directory "' . realpath($sharedDir) . '" created'; |
|
| 166 | 166 | } else { |
| 167 | 167 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 168 | 168 | $payload->setMessage('directory "' . $sharedDir . '" does not created'); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $logFile = $path . DIRECTORY_SEPARATOR . 'deploid.log'; |
| 175 | 175 | if (!is_file($logFile)) { |
| 176 | 176 | if (touch($logFile)) { |
| 177 | - $messages[] = 'file "' . realpath($logFile) . '" created'; |
|
| 177 | + $messages[ ] = 'file "' . realpath($logFile) . '" created'; |
|
| 178 | 178 | } else { |
| 179 | 179 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 180 | 180 | $payload->setMessage('file"' . $logFile . '" does not created'); |
@@ -207,8 +207,8 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | $paths = glob(realpath($path) . DIRECTORY_SEPARATOR . '*'); |
| 209 | 209 | |
| 210 | - $paths = array_filter($paths, function ($path) { |
|
| 211 | - return !in_array(basename($path), $this->structure['dirs'] + $this->structure['links'] + $this->structure['files']); |
|
| 210 | + $paths = array_filter($paths, function($path) { |
|
| 211 | + return !in_array(basename($path), $this->structure[ 'dirs' ] + $this->structure[ 'links' ] + $this->structure[ 'files' ]); |
|
| 212 | 212 | }); |
| 213 | 213 | |
| 214 | 214 | foreach ($paths as $pathname) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | $payload->setType(Payload::STRUCTURE_CLEAN_SUCCESS); |
| 223 | - $payload->setMessage(array_merge(['cleaned items:'], $paths)); |
|
| 223 | + $payload->setMessage(array_merge([ 'cleaned items:' ], $paths)); |
|
| 224 | 224 | $payload->setCode(0); |
| 225 | 225 | return $payload; |
| 226 | 226 | } |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | return $payload; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - $dirs = array_map(function ($path) { |
|
| 370 | + $dirs = array_map(function($path) { |
|
| 371 | 371 | return basename($path); |
| 372 | 372 | }, $dirs); |
| 373 | 373 | |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | return $payload; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | - $dirs = array_map(function ($path) { |
|
| 405 | + $dirs = array_map(function($path) { |
|
| 406 | 406 | return basename($path); |
| 407 | 407 | }, $dirs); |
| 408 | 408 | |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | if (empty($path)) throw new \InvalidArgumentException('empty path'); |
| 551 | 551 | if (empty($cwd)) throw new \InvalidArgumentException('empty cwd'); |
| 552 | 552 | |
| 553 | - if ($path[0] == '/') return $path; |
|
| 553 | + if ($path[ 0 ] == '/') return $path; |
|
| 554 | 554 | |
| 555 | 555 | return $cwd . DIRECTORY_SEPARATOR . $path; |
| 556 | 556 | } |