@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | if (empty($item)) continue; |
| 85 | 85 | if ($section == 'dirs') mkdir($path . DIRECTORY_SEPARATOR . $item, $this->chmod, true); |
| 86 | 86 | if ($section == 'files') touch($path . DIRECTORY_SEPARATOR . $item); |
| 87 | - if ($section == 'links') symlink($path . DIRECTORY_SEPARATOR . (explode(':', $item)[1]), $path . DIRECTORY_SEPARATOR . (explode(':', $item)[0])); |
|
| 87 | + if ($section == 'links') symlink($path . DIRECTORY_SEPARATOR . (explode(':', $item)[ 1 ]), $path . DIRECTORY_SEPARATOR . (explode(':', $item)[ 0 ])); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | $path = $this->absolutePath($path, getcwd()); |
| 150 | - $messages = []; |
|
| 150 | + $messages = [ ]; |
|
| 151 | 151 | |
| 152 | 152 | if (!is_dir($path)) { |
| 153 | 153 | if (mkdir($path, $this->chmod, true)) { |
| 154 | - $messages[] = 'directory "' . realpath($path) . '" created'; |
|
| 154 | + $messages[ ] = 'directory "' . realpath($path) . '" created'; |
|
| 155 | 155 | } else { |
| 156 | 156 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 157 | 157 | $payload->setMessage('directory "' . $path . '" does not created'); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | if ($section == 'dirs') { |
| 168 | 168 | $dir = $path . DIRECTORY_SEPARATOR . $item; |
| 169 | 169 | if (mkdir($dir, $this->chmod, true)) { |
| 170 | - $messages[] = 'directory "' . realpath($dir) . '" created'; |
|
| 170 | + $messages[ ] = 'directory "' . realpath($dir) . '" created'; |
|
| 171 | 171 | } else { |
| 172 | 172 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 173 | 173 | $payload->setMessage('directory "' . $dir . '" does not created'); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | if ($section == 'files') { |
| 179 | 179 | $file = $path . DIRECTORY_SEPARATOR . $item; |
| 180 | 180 | if (touch($file)) { |
| 181 | - $messages[] = 'file "' . realpath($file) . '" created'; |
|
| 181 | + $messages[ ] = 'file "' . realpath($file) . '" created'; |
|
| 182 | 182 | } else { |
| 183 | 183 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 184 | 184 | $payload->setMessage('file"' . $file . '" does not created'); |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | if ($section == 'links') { |
| 190 | - $target = $path . DIRECTORY_SEPARATOR . (explode(':', $item)[1]); |
|
| 191 | - $link = $path . DIRECTORY_SEPARATOR . (explode(':', $item)[0]); |
|
| 190 | + $target = $path . DIRECTORY_SEPARATOR . (explode(':', $item)[ 1 ]); |
|
| 191 | + $link = $path . DIRECTORY_SEPARATOR . (explode(':', $item)[ 0 ]); |
|
| 192 | 192 | if (symlink($target, $link)) { |
| 193 | - $messages[] = 'link "' . realpath($link) . '" created'; |
|
| 193 | + $messages[ ] = 'link "' . realpath($link) . '" created'; |
|
| 194 | 194 | } else { |
| 195 | 195 | $payload->setType(Payload::STRUCTURE_INIT_FAIL); |
| 196 | 196 | $payload->setMessage('link ' . $link . '" does not created'); |
@@ -225,8 +225,8 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | $paths = glob(realpath($path) . DIRECTORY_SEPARATOR . '*'); |
| 227 | 227 | |
| 228 | - $paths = array_filter($paths, function ($path) { |
|
| 229 | - return !in_array(basename($path), $this->structure['dirs'] + $this->structure['links'] + $this->structure['files']); |
|
| 228 | + $paths = array_filter($paths, function($path) { |
|
| 229 | + return !in_array(basename($path), $this->structure[ 'dirs' ] + $this->structure[ 'links' ] + $this->structure[ 'files' ]); |
|
| 230 | 230 | }); |
| 231 | 231 | |
| 232 | 232 | foreach ($paths as $pathname) { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $payload->setType(Payload::STRUCTURE_CLEAN_SUCCESS); |
| 243 | - $payload->setMessage(array_merge(['cleaned items:'], $paths)); |
|
| 243 | + $payload->setMessage(array_merge([ 'cleaned items:' ], $paths)); |
|
| 244 | 244 | $payload->setCode(0); |
| 245 | 245 | return $payload; |
| 246 | 246 | } |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | return $payload; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - $dirs = array_map(function ($path) { |
|
| 390 | + $dirs = array_map(function($path) { |
|
| 391 | 391 | return basename($path); |
| 392 | 392 | }, $dirs); |
| 393 | 393 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | return $payload; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - $dirs = array_map(function ($path) { |
|
| 425 | + $dirs = array_map(function($path) { |
|
| 426 | 426 | return basename($path); |
| 427 | 427 | }, $dirs); |
| 428 | 428 | |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | if (empty($path)) throw new \InvalidArgumentException('empty path'); |
| 571 | 571 | if (empty($cwd)) throw new \InvalidArgumentException('empty cwd'); |
| 572 | 572 | |
| 573 | - if ($path[0] == '/') return $path; |
|
| 573 | + if ($path[ 0 ] == '/') return $path; |
|
| 574 | 574 | |
| 575 | 575 | return $cwd . DIRECTORY_SEPARATOR . $path; |
| 576 | 576 | } |