@@ -130,7 +130,7 @@ |
||
| 130 | 130 | |
| 131 | 131 | public function cloneTask() |
| 132 | 132 | { |
| 133 | - $reflect = new \ReflectionClass(get_class($this->task)); |
|
| 133 | + $reflect = new \ReflectionClass(get_class($this->task)); |
|
| 134 | 134 | return $reflect->newInstanceArgs(func_get_args()); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -31,10 +31,10 @@ |
||
| 31 | 31 | { |
| 32 | 32 | $createRoboFile = new Command('init'); |
| 33 | 33 | $createRoboFile->setDescription("Intitalizes basic RoboFile in current dir"); |
| 34 | - $createRoboFile->setCode(function () use ($roboClass, $roboFile) { |
|
| 34 | + $createRoboFile->setCode(function() use ($roboClass, $roboFile) { |
|
| 35 | 35 | $output = Robo::output(); |
| 36 | 36 | $output->writeln("<comment> ~~~ Welcome to Robo! ~~~~ </comment>"); |
| 37 | - $output->writeln("<comment> ". basename($roboFile) ." will be created in the current directory </comment>"); |
|
| 37 | + $output->writeln("<comment> " . basename($roboFile) . " will be created in the current directory </comment>"); |
|
| 38 | 38 | file_put_contents( |
| 39 | 39 | $roboFile, |
| 40 | 40 | '<?php' |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | ->withMethodCall( |
| 144 | 144 | 'setDisplayErrorFunction', |
| 145 | 145 | [ |
| 146 | - function ($output, $message) use ($container) { |
|
| 146 | + function($output, $message) use ($container) { |
|
| 147 | 147 | $logger = $container->get('logger'); |
| 148 | 148 | $logger->error($message); |
| 149 | 149 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | { |
| 37 | 37 | if (!static::$collection) { |
| 38 | 38 | static::$collection = \Robo\Robo::getContainer()->get('collection'); |
| 39 | - register_shutdown_function(function () { |
|
| 39 | + register_shutdown_function(function() { |
|
| 40 | 40 | static::complete(); |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function call(callable $fn) |
| 60 | 60 | { |
| 61 | 61 | return $this->withEachKeyValueCall( |
| 62 | - function ($key, $value) use ($fn) { |
|
| 62 | + function($key, $value) use ($fn) { |
|
| 63 | 63 | return call_user_func($fn, $value); |
| 64 | 64 | } |
| 65 | 65 | ); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public function withBuilder(callable $fn) |
| 69 | 69 | { |
| 70 | 70 | $this->countingStack[] = |
| 71 | - function ($key, $value) use ($fn) { |
|
| 71 | + function($key, $value) use ($fn) { |
|
| 72 | 72 | // Create a new builder for every iteration |
| 73 | 73 | $builder = $this->collectionBuilder(); |
| 74 | 74 | // The user function should build task operations using |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | return $builder->getCollection()->progressIndicatorSteps(); |
| 79 | 79 | }; |
| 80 | 80 | return $this->withEachKeyValueCall( |
| 81 | - function ($key, $value) use ($fn) { |
|
| 81 | + function($key, $value) use ($fn) { |
|
| 82 | 82 | // Create a new builder for every iteration |
| 83 | 83 | $builder = $this->collectionBuilder() |
| 84 | 84 | ->setParentCollection($this->parentCollection); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $collection = $this; |
| 109 | 109 | $completionRegistrationTask = new CallableTask( |
| 110 | - function () use ($collection, $completionTask) { |
|
| 110 | + function() use ($collection, $completionTask) { |
|
| 111 | 111 | |
| 112 | 112 | $collection->registerCompletion($completionTask); |
| 113 | 113 | }, |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $context += ['name' => 'Progress']; |
| 151 | 151 | $context += TaskInfo::getTaskContext($this); |
| 152 | 152 | return $this->addCode( |
| 153 | - function () use ($level, $text, $context) { |
|
| 153 | + function() use ($level, $text, $context) { |
|
| 154 | 154 | $this->printTaskOutput($level, $text, $context); |
| 155 | 155 | } |
| 156 | 156 | ); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $collection = $this; |
| 162 | 162 | $rollbackRegistrationTask = new CallableTask( |
| 163 | - function () use ($collection, $rollbackTask) { |
|
| 163 | + function() use ($collection, $rollbackTask) { |
|
| 164 | 164 | $collection->registerRollback($rollbackTask); |
| 165 | 165 | }, |
| 166 | 166 | $this |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | if ($task instanceof StackBasedTask) { |
| 203 | 203 | $task->stopOnFail(false); |
| 204 | 204 | } |
| 205 | - $ignoreErrorsInTask = function () use ($task) { |
|
| 205 | + $ignoreErrorsInTask = function() use ($task) { |
|
| 206 | 206 | $data = []; |
| 207 | 207 | try { |
| 208 | 208 | $result = $this->runSubtask($task); |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | if (empty($version)) { |
| 130 | 130 | $versionParts = explode('.', \Robo\Robo::VERSION); |
| 131 | - $versionParts[count($versionParts)-1]++; |
|
| 131 | + $versionParts[count($versionParts) - 1]++; |
|
| 132 | 132 | $version = implode('.', $versionParts); |
| 133 | 133 | } |
| 134 | - return $this->taskReplaceInFile(__DIR__.'/src/Robo.php') |
|
| 135 | - ->from("VERSION = '".\Robo\Robo::VERSION."'") |
|
| 136 | - ->to("VERSION = '".$version."'") |
|
| 134 | + return $this->taskReplaceInFile(__DIR__ . '/src/Robo.php') |
|
| 135 | + ->from("VERSION = '" . \Robo\Robo::VERSION . "'") |
|
| 136 | + ->to("VERSION = '" . $version . "'") |
|
| 137 | 137 | ->run(); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | foreach ($docs as $ns => $tasks) { |
| 167 | 167 | $taskGenerator = $collection->taskGenDoc("docs/tasks/$ns.md"); |
| 168 | - $taskGenerator->filterClasses(function (\ReflectionClass $r) { |
|
| 168 | + $taskGenerator->filterClasses(function(\ReflectionClass $r) { |
|
| 169 | 169 | return !($r->isAbstract() || $r->isTrait()) && $r->implementsInterface('Robo\Contract\TaskInterface'); |
| 170 | 170 | })->prepend("# $ns Tasks"); |
| 171 | 171 | sort($tasks); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | $taskGenerator->filterMethods( |
| 177 | - function (\ReflectionMethod $m) { |
|
| 177 | + function(\ReflectionMethod $m) { |
|
| 178 | 178 | if ($m->isConstructor() || $m->isDestructor() || $m->isStatic()) { |
| 179 | 179 | return false; |
| 180 | 180 | } |
@@ -200,21 +200,21 @@ discard block |
||
| 200 | 200 | return !in_array($m->name, $undocumentedMethods) && $m->isPublic(); // methods are not documented |
| 201 | 201 | } |
| 202 | 202 | )->processClassSignature( |
| 203 | - function ($c) { |
|
| 203 | + function($c) { |
|
| 204 | 204 | return "## " . preg_replace('~Task$~', '', $c->getShortName()) . "\n"; |
| 205 | 205 | } |
| 206 | 206 | )->processClassDocBlock( |
| 207 | - function (\ReflectionClass $c, $doc) { |
|
| 207 | + function(\ReflectionClass $c, $doc) { |
|
| 208 | 208 | $doc = preg_replace('~@method .*?(.*?)\)~', '* `$1)` ', $doc); |
| 209 | - $doc = str_replace('\\'.$c->name, '', $doc); |
|
| 209 | + $doc = str_replace('\\' . $c->name, '', $doc); |
|
| 210 | 210 | return $doc; |
| 211 | 211 | } |
| 212 | 212 | )->processMethodSignature( |
| 213 | - function (\ReflectionMethod $m, $text) { |
|
| 213 | + function(\ReflectionMethod $m, $text) { |
|
| 214 | 214 | return str_replace('#### *public* ', '* `', $text) . '`'; |
| 215 | 215 | } |
| 216 | 216 | )->processMethodDocBlock( |
| 217 | - function (\ReflectionMethod $m, $text) { |
|
| 217 | + function(\ReflectionMethod $m, $text) { |
|
| 218 | 218 | |
| 219 | 219 | return $text ? ' ' . trim(strtok($text, "\n"), "\n") : ''; |
| 220 | 220 | } |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | protected function devDependenciesToRemoveFromPhar() |
| 325 | 325 | { |
| 326 | - $composerInfo = (array) json_decode(file_get_contents(__DIR__ . '/composer.json')); |
|
| 326 | + $composerInfo = (array)json_decode(file_get_contents(__DIR__ . '/composer.json')); |
|
| 327 | 327 | |
| 328 | 328 | $devDependencies = array_keys((array)$composerInfo['require-dev']); |
| 329 | 329 | $suggestedProjects = array_keys((array)$composerInfo['suggest']); |