@@ -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'; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } catch (\InvalidArgumentException $e) { |
| 290 | 290 | // if finder cannot handle it, try with in()->name() |
| 291 | 291 | if (strpos($dir, '/') === false) { |
| 292 | - $dir = './'.$dir; |
|
| 292 | + $dir = './' . $dir; |
|
| 293 | 293 | } |
| 294 | 294 | $parts = explode('/', $dir); |
| 295 | 295 | $new_dir = implode('/', array_slice($parts, 0, -1)); |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | */ |
| 320 | 320 | protected function getTarget($file, $to) |
| 321 | 321 | { |
| 322 | - $target = $to.'/'.basename($file); |
|
| 322 | + $target = $to . '/' . basename($file); |
|
| 323 | 323 | |
| 324 | 324 | return $target; |
| 325 | 325 | } |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | protected function getOS() |
| 433 | 433 | { |
| 434 | 434 | $os = php_uname('s'); |
| 435 | - $os .= '/'.php_uname('m'); |
|
| 435 | + $os .= '/' . php_uname('m'); |
|
| 436 | 436 | // replace x86_64 to x64, because the imagemin repo uses that |
| 437 | 437 | $os = str_replace('x86_64', 'x64', $os); |
| 438 | 438 | // replace i386, i686, etc to x86, because of imagemin |
@@ -492,10 +492,10 @@ discard block |
||
| 492 | 492 | $this->printTaskInfo('Downloading the {executable} executable from the imagemin repository', ['executable' => $executable]); |
| 493 | 493 | |
| 494 | 494 | $os = $this->getOS(); |
| 495 | - $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'?raw=true'; |
|
| 495 | + $url = $this->imageminRepos[$executable] . '/blob/master/vendor/' . $os . '/' . $executable . '?raw=true'; |
|
| 496 | 496 | if (substr($os, 0, 3) == 'win') { |
| 497 | 497 | // if it is win, add a .exe extension |
| 498 | - $url = $this->imageminRepos[$executable].'/blob/master/vendor/'.$os.'/'.$executable.'.exe?raw=true'; |
|
| 498 | + $url = $this->imageminRepos[$executable] . '/blob/master/vendor/' . $os . '/' . $executable . '.exe?raw=true'; |
|
| 499 | 499 | } |
| 500 | 500 | $data = @file_get_contents($url, false, null); |
| 501 | 501 | if ($data === false) { |
@@ -525,10 +525,10 @@ discard block |
||
| 525 | 525 | mkdir($this->executableTargetDir); |
| 526 | 526 | } |
| 527 | 527 | // save the executable into the target dir |
| 528 | - $path = $this->executableTargetDir.'/'.$executable; |
|
| 528 | + $path = $this->executableTargetDir . '/' . $executable; |
|
| 529 | 529 | if (substr($os, 0, 3) == 'win') { |
| 530 | 530 | // if it is win, add a .exe extension |
| 531 | - $path = $this->executableTargetDir.'/'.$executable.'.exe'; |
|
| 531 | + $path = $this->executableTargetDir . '/' . $executable . '.exe'; |
|
| 532 | 532 | } |
| 533 | 533 | $result = file_put_contents($path, $data); |
| 534 | 534 | if ($result === false) { |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | chmod($path, 0755); |
| 541 | 541 | |
| 542 | 542 | // if everything successful, store the executable path |
| 543 | - $this->executablePaths[$executable] = $this->executableTargetDir.'/'.$executable; |
|
| 543 | + $this->executablePaths[$executable] = $this->executableTargetDir . '/' . $executable; |
|
| 544 | 544 | // if it is win, add a .exe extension |
| 545 | 545 | if (substr($os, 0, 3) == 'win') { |
| 546 | 546 | $this->executablePaths[$executable] .= '.exe'; |
@@ -88,6 +88,6 @@ |
||
| 88 | 88 | */ |
| 89 | 89 | public function getCommand() |
| 90 | 90 | { |
| 91 | - return $this->command . ' ' . $this->arguments . ' ' . $this->cid.' '.$this->run; |
|
| 91 | + return $this->command . ' ' . $this->arguments . ' ' . $this->cid . ' ' . $this->run; |
|
| 92 | 92 | } |
| 93 | 93 | } |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | { |
| 130 | 130 | // run() will call advanceProgressIndicator() once for each |
| 131 | 131 | // file, one after calling stopBuffering, and again after compression. |
| 132 | - return count($this->files)+2; |
|
| 132 | + return count($this->files) + 2; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function __construct($url) |
| 37 | 37 | { |
| 38 | - $this->urls = (array) $url; |
|
| 38 | + $this->urls = (array)$url; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | */ |
| 190 | 190 | public function cloneTask() |
| 191 | 191 | { |
| 192 | - $reflect = new \ReflectionClass(get_class($this->task)); |
|
| 192 | + $reflect = new \ReflectionClass(get_class($this->task)); |
|
| 193 | 193 | return $reflect->newInstanceArgs(func_get_args()); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function tryWatch() |
| 31 | 31 | { |
| 32 | - $this->taskWatch()->monitor(['composer.json', 'composer.lock'], function () { |
|
| 32 | + $this->taskWatch()->monitor(['composer.json', 'composer.lock'], function() { |
|
| 33 | 33 | $this->taskComposerUpdate()->run(); |
| 34 | 34 | })->run(); |
| 35 | 35 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $this->say('The <b>expression</b> <bogus>is</bogus> <info>a < b</> it even works'); |
| 43 | 43 | $answer = $this->ask('how are you?'); |
| 44 | - $this->say('You are '.$answer); |
|
| 44 | + $this->say('You are ' . $answer); |
|
| 45 | 45 | $yes = $this->confirm('Do you want one more question?'); |
| 46 | 46 | if (!$yes) { |
| 47 | 47 | return Result::cancelled(); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $lang = $this->askDefault('what is your favorite scripting language?', 'PHP'); |
| 50 | 50 | $this->say($lang); |
| 51 | 51 | $pin = $this->askHidden('Ok, now tell your PIN code (it is hidden)'); |
| 52 | - $this->yell('Ha-ha, your pin code is: '.$pin); |
|
| 52 | + $this->yell('Ha-ha, your pin code is: ' . $pin); |
|
| 53 | 53 | $this->say('Bye!'); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // using yaml or json output formats. |
| 174 | 174 | $data->addRendererFunction( |
| 175 | 175 | // n.b. There is a fourth parameter $rowData that may be added here. |
| 176 | - function ($key, $cellData, FormatterOptions $options) { |
|
| 176 | + function($key, $cellData, FormatterOptions $options) { |
|
| 177 | 177 | if ($key == 'name') { |
| 178 | 178 | return "<info>$cellData</>"; |
| 179 | 179 | } |
@@ -203,10 +203,10 @@ discard block |
||
| 203 | 203 | public function tryFormatters($somthing = 'default', $options = ['format' => 'table', 'fields' => '']) |
| 204 | 204 | { |
| 205 | 205 | $outputData = [ |
| 206 | - 'en' => [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], |
|
| 207 | - 'de' => [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], |
|
| 208 | - 'jp' => [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], |
|
| 209 | - 'es' => [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], |
|
| 206 | + 'en' => ['first' => 'One', 'second' => 'Two', 'third' => 'Three'], |
|
| 207 | + 'de' => ['first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei'], |
|
| 208 | + 'jp' => ['first' => 'Ichi', 'second' => 'Ni', 'third' => 'San'], |
|
| 209 | + 'es' => ['first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres'], |
|
| 210 | 210 | ]; |
| 211 | 211 | return new RowsOfFields($outputData); |
| 212 | 212 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | public function alterFormatters($result, CommandData $commandData) |
| 242 | 242 | { |
| 243 | 243 | if ($commandData->input()->getOption('french')) { |
| 244 | - $result['fr'] = [ 'first' => 'Un', 'second' => 'Deux', 'third' => 'Trois' ]; |
|
| 244 | + $result['fr'] = ['first' => 'Un', 'second' => 'Deux', 'third' => 'Trois']; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | return $result; |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | ->taskForEach($processList) |
| 397 | 397 | ->iterationMessage('Processing {value}') |
| 398 | 398 | ->call( |
| 399 | - function ($value) use($delay) { |
|
| 399 | + function($value) use($delay) { |
|
| 400 | 400 | // TaskForEach::call should only be used to do |
| 401 | 401 | // non-Robo operations. To use Robo tasks in an |
| 402 | 402 | // iterator, @see TaskForEach::withBuilder. |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | ->taskCleanDir($workdir) |
| 419 | 419 | ->taskForEach($processList) |
| 420 | 420 | ->withBuilder( |
| 421 | - function ($builder, $key, $value) use ($workdir) { |
|
| 421 | + function($builder, $key, $value) use ($workdir) { |
|
| 422 | 422 | return $builder |
| 423 | 423 | ->taskFilesystemStack() |
| 424 | 424 | ->mkdir("$workdir/$value"); |
@@ -247,7 +247,7 @@ |
||
| 247 | 247 | $this->process = $process; |
| 248 | 248 | |
| 249 | 249 | if (!$output_callback) { |
| 250 | - $output_callback = function ($type, $buffer) { |
|
| 250 | + $output_callback = function($type, $buffer) { |
|
| 251 | 251 | $progressWasVisible = $this->hideTaskProgress(); |
| 252 | 252 | $this->writeMessage($buffer); |
| 253 | 253 | $this->showTaskProgress($progressWasVisible); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | if (!is_array($args)) { |
| 72 | 72 | $args = func_get_args(); |
| 73 | 73 | } |
| 74 | - $args = array_map(function ($arg) { |
|
| 74 | + $args = array_map(function($arg) { |
|
| 75 | 75 | if (preg_match('/^\w+$/', trim($arg)) === 1) { |
| 76 | 76 | $this->operation = $arg; |
| 77 | 77 | return null; |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | $a = new ResultData(ResultData::EXITCODE_OK, '', ['one' => 'first', 'two' => 'second']); |
| 34 | 34 | |
| 35 | 35 | $to_be_merged = [ |
| 36 | - ['one' => 'ignored',], |
|
| 37 | - ['three' => 'new',], |
|
| 36 | + ['one' => 'ignored', ], |
|
| 37 | + ['three' => 'new', ], |
|
| 38 | 38 | ]; |
| 39 | 39 | |
| 40 | 40 | foreach ($to_be_merged as $mergeThis) { |