@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function dirPermissions($permission) |
| 112 | 112 | { |
| 113 | - $this->chmod = (int) $permission; |
|
| 113 | + $this->chmod = (int)$permission; |
|
| 114 | 114 | |
| 115 | 115 | return $this; |
| 116 | 116 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | if (!$this->fs->isAbsolutePath($dir)) { |
| 159 | 159 | // attach the relative path to current working directory |
| 160 | - $dir = getcwd().'/'.$dir; |
|
| 160 | + $dir = getcwd() . '/' . $dir; |
|
| 161 | 161 | } |
| 162 | 162 | $this->parentDir = $dir; |
| 163 | 163 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } catch (\InvalidArgumentException $e) { |
| 205 | 205 | // if finder cannot handle it, try with in()->name() |
| 206 | 206 | if (strpos($dir, '/') === false) { |
| 207 | - $dir = './'.$dir; |
|
| 207 | + $dir = './' . $dir; |
|
| 208 | 208 | } |
| 209 | 209 | $parts = explode('/', $dir); |
| 210 | 210 | $new_dir = implode('/', array_slice($parts, 0, -1)); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | protected function getTarget($file, $to) |
| 230 | 230 | { |
| 231 | - $target = $to.'/'.basename($file); |
|
| 231 | + $target = $to . '/' . basename($file); |
|
| 232 | 232 | if ($this->parents !== array(0, 0)) { |
| 233 | 233 | // if the parent is set, create additional directories inside target |
| 234 | 234 | // get relative path to parentDir |
@@ -236,10 +236,10 @@ discard block |
||
| 236 | 236 | // get top parents and bottom parents |
| 237 | 237 | $parts = explode('/', rtrim($rel_path, '/')); |
| 238 | 238 | $prefix_dir = ''; |
| 239 | - $prefix_dir .= ($this->parents[0] > 0 ? implode('/', array_slice($parts, 0, $this->parents[0])).'/' : ''); |
|
| 239 | + $prefix_dir .= ($this->parents[0] > 0 ? implode('/', array_slice($parts, 0, $this->parents[0])) . '/' : ''); |
|
| 240 | 240 | $prefix_dir .= ($this->parents[1] > 0 ? implode('/', array_slice($parts, (0 - $this->parents[1]), $this->parents[1])) : ''); |
| 241 | 241 | $prefix_dir = rtrim($prefix_dir, '/'); |
| 242 | - $target = $to.'/'.$prefix_dir.'/'.basename($file); |
|
| 242 | + $target = $to . '/' . $prefix_dir . '/' . basename($file); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | return $target; |
@@ -218,7 +218,7 @@ |
||
| 218 | 218 | */ |
| 219 | 219 | public function __toString() |
| 220 | 220 | { |
| 221 | - return (string) $this->getMinifiedText(); |
|
| 221 | + return (string)$this->getMinifiedText(); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | // guess the best path for the executables based on __DIR__ |
| 183 | 183 | if (($pos = strpos(__DIR__, 'consolidation/robo')) !== false) { |
| 184 | 184 | // the executables should be stored in vendor/bin |
| 185 | - $this->executableTargetDir = substr(__DIR__, 0, $pos).'bin'; |
|
| 185 | + $this->executableTargetDir = substr(__DIR__, 0, $pos) . 'bin'; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // check if the executables are already available |
| 189 | 189 | foreach ($this->imageminRepos as $exec => $url) { |
| 190 | - $path = $this->executableTargetDir.'/'.$exec; |
|
| 190 | + $path = $this->executableTargetDir . '/' . $exec; |
|
| 191 | 191 | // if this is Windows add a .exe extension |
| 192 | 192 | if (substr($this->getOS(), 0, 3) == 'win') { |
| 193 | 193 | $path .= '.exe'; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } catch (\InvalidArgumentException $e) { |
| 280 | 280 | // if finder cannot handle it, try with in()->name() |
| 281 | 281 | if (strpos($dir, '/') === false) { |
| 282 | - $dir = './'.$dir; |
|
| 282 | + $dir = './' . $dir; |
|
| 283 | 283 | } |
| 284 | 284 | $parts = explode('/', $dir); |
| 285 | 285 | $new_dir = implode('/', array_slice($parts, 0, -1)); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | protected function getTarget($file, $to) |
| 305 | 305 | { |
| 306 | - $target = $to.'/'.basename($file); |
|
| 306 | + $target = $to . '/' . basename($file); |
|
| 307 | 307 | |
| 308 | 308 | return $target; |
| 309 | 309 | } |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | protected function getOS() |
| 409 | 409 | { |
| 410 | 410 | $os = php_uname('s'); |
| 411 | - $os .= '/'.php_uname('m'); |
|
| 411 | + $os .= '/' . php_uname('m'); |
|
| 412 | 412 | // replace x86_64 to x64, because the imagemin repo uses that |
| 413 | 413 | $os = str_replace('x86_64', 'x64', $os); |
| 414 | 414 | // replace i386, i686, etc to x86, because of imagemin |
@@ -458,10 +458,10 @@ discard block |
||
| 458 | 458 | $this->printTaskInfo('Downloading the {executable} executable from the imagemin repository', ['executable' => $executable]); |
| 459 | 459 | |
| 460 | 460 | $os = $this->getOS(); |
| 461 | - $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'?raw=true'; |
|
| 461 | + $url = $this->imageminRepos[$executable] . '/blob/master/vendor/' . $os . '/' . $executable . '?raw=true'; |
|
| 462 | 462 | if (substr($os, 0, 3) == 'win') { |
| 463 | 463 | // if it is win, add a .exe extension |
| 464 | - $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'.exe?raw=true'; |
|
| 464 | + $url = $this->imageminRepos[$executable] . '/blob/master/vendor/' . $os . '/' . $executable . '.exe?raw=true'; |
|
| 465 | 465 | } |
| 466 | 466 | $data = @file_get_contents($url, false, null); |
| 467 | 467 | if ($data === false) { |
@@ -491,10 +491,10 @@ discard block |
||
| 491 | 491 | mkdir($this->executableTargetDir); |
| 492 | 492 | } |
| 493 | 493 | // save the executable into the target dir |
| 494 | - $path = $this->executableTargetDir.'/'.$executable; |
|
| 494 | + $path = $this->executableTargetDir . '/' . $executable; |
|
| 495 | 495 | if (substr($os, 0, 3) == 'win') { |
| 496 | 496 | // if it is win, add a .exe extension |
| 497 | - $path = $this->executableTargetDir.'/'.$executable.'.exe'; |
|
| 497 | + $path = $this->executableTargetDir . '/' . $executable . '.exe'; |
|
| 498 | 498 | } |
| 499 | 499 | $result = file_put_contents($path, $data); |
| 500 | 500 | if ($result === false) { |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | chmod($path, 0755); |
| 507 | 507 | |
| 508 | 508 | // if everything successful, store the executable path |
| 509 | - $this->executablePaths[$executable] = $this->executableTargetDir.'/'.$executable; |
|
| 509 | + $this->executablePaths[$executable] = $this->executableTargetDir . '/' . $executable; |
|
| 510 | 510 | // if it is win, add a .exe extension |
| 511 | 511 | if (substr($os, 0, 3) == 'win') { |
| 512 | 512 | $this->executablePaths[$executable] .= '.exe'; |
@@ -61,6 +61,6 @@ |
||
| 61 | 61 | |
| 62 | 62 | public function getCommand() |
| 63 | 63 | { |
| 64 | - return $this->command . ' ' . $this->arguments . ' ' . $this->cid.' '.$this->run; |
|
| 64 | + return $this->command . ' ' . $this->arguments . ' ' . $this->cid . ' ' . $this->run; |
|
| 65 | 65 | } |
| 66 | 66 | } |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | { |
| 100 | 100 | // run() will call advanceProgressIndicator() once for each |
| 101 | 101 | // file, one after calling stopBuffering, and again after compression. |
| 102 | - return count($this->files)+2; |
|
| 102 | + return count($this->files) + 2; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | public function run() |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | $text = implode( |
| 102 | 102 | "\n", |
| 103 | 103 | array_map( |
| 104 | - function ($i) { |
|
| 104 | + function($i) { |
|
| 105 | 105 | return "* $i *" . date('Y-m-d') . "*"; |
| 106 | 106 | }, |
| 107 | 107 | $this->log |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | public function __construct($url) |
| 31 | 31 | { |
| 32 | - $this->urls = (array) $url; |
|
| 32 | + $this->urls = (array)$url; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function run() |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | $methods = array_filter($methods); |
| 301 | 301 | |
| 302 | - $doc .= implode("\n", $methods)."\n"; |
|
| 302 | + $doc .= implode("\n", $methods) . "\n"; |
|
| 303 | 303 | |
| 304 | 304 | return $doc; |
| 305 | 305 | } |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | return implode( |
| 457 | 457 | "\n", |
| 458 | 458 | array_map( |
| 459 | - function ($line) use ($indent) { |
|
| 459 | + function($line) use ($indent) { |
|
| 460 | 460 | return substr($line, $indent); |
| 461 | 461 | }, |
| 462 | 462 | explode("\n", $doc) |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $params = implode( |
| 474 | 474 | ', ', |
| 475 | 475 | array_map( |
| 476 | - function ($p) { |
|
| 476 | + function($p) { |
|
| 477 | 477 | return $this->documentParam($p); |
| 478 | 478 | }, |
| 479 | 479 | $reflectedMethod->getParameters() |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | $body = $this->description; |
| 95 | 95 | if (!empty($this->changes)) { |
| 96 | 96 | $changes = array_map( |
| 97 | - function ($line) { |
|
| 97 | + function($line) { |
|
| 98 | 98 | return "* $line"; |
| 99 | 99 | }, |
| 100 | 100 | $this->changes |