@@ -1,8 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Robo\Result; |
| 3 | 3 | use Robo\ResultData; |
| 4 | -use Robo\Collection\CollectionBuilder; |
|
| 5 | - |
|
| 6 | 4 | use Consolidation\OutputFormatters\StructuredData\RowsOfFields; |
| 7 | 5 | |
| 8 | 6 | /** |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function tryWatch() |
| 25 | 25 | { |
| 26 | - $this->taskWatch()->monitor(['composer.json', 'composer.lock'], function () { |
|
| 26 | + $this->taskWatch()->monitor(['composer.json', 'composer.lock'], function() { |
|
| 27 | 27 | $this->taskComposerUpdate()->run(); |
| 28 | 28 | })->run(); |
| 29 | 29 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public function tryInput() |
| 35 | 35 | { |
| 36 | 36 | $answer = $this->ask('how are you?'); |
| 37 | - $this->say('You are '.$answer); |
|
| 37 | + $this->say('You are ' . $answer); |
|
| 38 | 38 | $yes = $this->confirm('Do you want one more question?'); |
| 39 | 39 | if (!$yes) { |
| 40 | 40 | return Result::cancelled(); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $lang = $this->askDefault('what is your favorite scripting language?', 'PHP'); |
| 43 | 43 | $this->say($lang); |
| 44 | 44 | $pin = $this->askHidden('Ok, now tell your PIN code (it is hidden)'); |
| 45 | - $this->yell('Ha-ha, your pin code is: '.$pin); |
|
| 45 | + $this->yell('Ha-ha, your pin code is: ' . $pin); |
|
| 46 | 46 | $this->say('Bye!'); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | public function tryFormatters($options = ['format' => 'table', 'fields' => '']) |
| 155 | 155 | { |
| 156 | 156 | $outputData = [ |
| 157 | - [ 'first' => 'One', 'second' => 'Two', 'third' => 'Three' ], |
|
| 158 | - [ 'first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei' ], |
|
| 159 | - [ 'first' => 'Ichi', 'second' => 'Ni', 'third' => 'San' ], |
|
| 160 | - [ 'first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres' ], |
|
| 157 | + ['first' => 'One', 'second' => 'Two', 'third' => 'Three'], |
|
| 158 | + ['first' => 'Eins', 'second' => 'Zwei', 'third' => 'Drei'], |
|
| 159 | + ['first' => 'Ichi', 'second' => 'Ni', 'third' => 'San'], |
|
| 160 | + ['first' => 'Uno', 'second' => 'Dos', 'third' => 'Tres'], |
|
| 161 | 161 | ]; |
| 162 | 162 | // Note that we can also simply return the output data array here. |
| 163 | 163 | return ResultData::message(new RowsOfFields($outputData)); |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | ->taskForEach($processList) |
| 313 | 313 | ->iterationMessage('Processing {value}') |
| 314 | 314 | ->call( |
| 315 | - function ($value) use($delay) { |
|
| 315 | + function($value) use($delay) { |
|
| 316 | 316 | // TaskForEach::call should only be used to do |
| 317 | 317 | // non-Robo operations. To use Robo tasks in an |
| 318 | 318 | // iterator, @see TaskForEach::withBuilder. |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | ->taskCleanDir($workdir) |
| 335 | 335 | ->taskForEach($processList) |
| 336 | 336 | ->withBuilder( |
| 337 | - function ($builder, $key, $value) use ($workdir) { |
|
| 337 | + function($builder, $key, $value) use ($workdir) { |
|
| 338 | 338 | return $builder |
| 339 | 339 | ->taskFilesystemStack() |
| 340 | 340 | ->mkdir("$workdir/$value"); |
@@ -1,7 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Symfony\Component\Finder\Finder; |
| 3 | -use Robo\Result; |
|
| 4 | -use Robo\Collection\CollectionBuilder; |
|
| 5 | 3 | |
| 6 | 4 | class RoboFile extends \Robo\Tasks |
| 7 | 5 | { |
@@ -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']); |
@@ -11,9 +11,6 @@ |
||
| 11 | 11 | use Robo\Exception\TaskException; |
| 12 | 12 | use Robo\Exception\TaskExitException; |
| 13 | 13 | use Robo\Contract\CommandInterface; |
| 14 | - |
|
| 15 | - |
|
| 16 | -use Robo\Common\ProgressIndicatorAwareTrait; |
|
| 17 | 14 | use Robo\Contract\InflectionInterface; |
| 18 | 15 | |
| 19 | 16 | /** |
@@ -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); |
@@ -2,7 +2,6 @@ discard block |
||
| 2 | 2 | namespace Robo\Collection; |
| 3 | 3 | |
| 4 | 4 | use Robo\Config; |
| 5 | -use Robo\Common\Timer; |
|
| 6 | 5 | use Psr\Log\LogLevel; |
| 7 | 6 | use Robo\Contract\TaskInterface; |
| 8 | 7 | use Robo\Contract\CompletionInterface; |
@@ -12,13 +11,10 @@ discard block |
||
| 12 | 11 | use Robo\Task\Simulator; |
| 13 | 12 | use Robo\Collection\CompletionWrapper; |
| 14 | 13 | use Robo\Collection\Temporary; |
| 15 | -use Robo\Contract\ConfigAwareInterface; |
|
| 16 | -use Robo\Common\ConfigAwareTrait; |
|
| 17 | 14 | use ReflectionClass; |
| 18 | 15 | use Robo\Task\BaseTask; |
| 19 | 16 | use Robo\Contract\BuilderAwareInterface; |
| 20 | 17 | use Robo\Contract\CommandInterface; |
| 21 | -use Robo\Exception\TaskException; |
|
| 22 | 18 | |
| 23 | 19 | /** |
| 24 | 20 | * Creates a collection, and adds tasks to it. The collection builder |
@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Robo\Collection; |
| 4 | 4 | |
| 5 | -use Robo\Contract\TaskInterface; |
|
| 6 | - |
|
| 7 | 5 | /** |
| 8 | 6 | * The temporary collection keeps track of the global collection of |
| 9 | 7 | * temporary cleanup tasks in instances where temporary-generating |
@@ -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 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Consolidation\Log\ConsoleLogLevel; |
| 7 | 7 | use Robo\Common\ConfigAwareTrait; |
| 8 | 8 | use Psr\Log\LoggerAwareTrait; |
| 9 | -use Psr\Log\LoggerInterface; |
|
| 10 | 9 | use Psr\Log\LogLevel; |
| 11 | 10 | use Robo\Contract\ProgressIndicatorAwareInterface; |
| 12 | 11 | |
@@ -2,13 +2,10 @@ |
||
| 2 | 2 | namespace Robo\Log; |
| 3 | 3 | |
| 4 | 4 | use Robo\Result; |
| 5 | -use Robo\TaskInfo; |
|
| 6 | 5 | use Robo\Contract\PrintedInterface; |
| 7 | 6 | use Robo\Contract\ProgressIndicatorAwareInterface; |
| 8 | 7 | use Robo\Common\ProgressIndicatorAwareTrait; |
| 9 | - |
|
| 10 | 8 | use Psr\Log\LogLevel; |
| 11 | -use Psr\Log\LoggerInterface; |
|
| 12 | 9 | use Psr\Log\LoggerAwareInterface; |
| 13 | 10 | use Psr\Log\LoggerAwareTrait; |
| 14 | 11 | use Consolidation\Log\ConsoleLogLevel; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | namespace Robo; |
| 3 | 3 | |
| 4 | 4 | use Robo\Contract\TaskInterface; |
| 5 | -use Robo\Contract\LogResultInterface; |
|
| 6 | 5 | use Robo\Exception\TaskExitException; |
| 7 | 6 | |
| 8 | 7 | class Result extends ResultData |
@@ -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 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | use League\Container\Container; |
| 5 | 5 | use League\Container\ContainerInterface; |
| 6 | - |
|
| 7 | 6 | use Symfony\Component\Console\Input\InputInterface; |
| 8 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
| 9 | 8 | use Symfony\Component\Console\Input\StringInput; |
@@ -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 | } |