@@ -2,7 +2,6 @@ discard block |
||
| 2 | 2 | namespace Robo\Collection; |
| 3 | 3 | |
| 4 | 4 | use Robo\Result; |
| 5 | -use Robo\ResultData; |
|
| 6 | 5 | use Psr\Log\LogLevel; |
| 7 | 6 | use Robo\Contract\TaskInterface; |
| 8 | 7 | use Robo\Task\StackBasedTask; |
@@ -12,7 +11,6 @@ discard block |
||
| 12 | 11 | use Robo\Exception\TaskException; |
| 13 | 12 | use Robo\Exception\TaskExitException; |
| 14 | 13 | use Robo\Contract\CommandInterface; |
| 15 | - |
|
| 16 | 14 | use Robo\Contract\InflectionInterface; |
| 17 | 15 | use Robo\State\StateAwareInterface; |
| 18 | 16 | use Robo\State\StateAwareTrait; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * |
| 208 | 208 | * @param string $method |
| 209 | 209 | * @param string $name |
| 210 | - * @param callable|TaskInterface $task |
|
| 210 | + * @param callable $task |
|
| 211 | 211 | * @param string $nameOfTaskToAdd |
| 212 | 212 | * |
| 213 | 213 | * @return $this |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | /** |
| 277 | 277 | * Return the list of task names added to this collection. |
| 278 | 278 | * |
| 279 | - * @return array |
|
| 279 | + * @return integer[] |
|
| 280 | 280 | */ |
| 281 | 281 | public function taskNames() |
| 282 | 282 | { |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
| 352 | - * @param int|string $name |
|
| 352 | + * @param string $name |
|
| 353 | 353 | * @param \Robo\Collection\Element $taskGroup |
| 354 | 354 | * |
| 355 | 355 | * @return $this |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | } |
| 636 | 636 | |
| 637 | 637 | /** |
| 638 | - * @param TaskInterface|NestedCollectionInterface|WrappedTaskInterface $task |
|
| 638 | + * @param TaskInterface $task |
|
| 639 | 639 | * |
| 640 | 640 | * @return \Robo\Result |
| 641 | 641 | */ |
@@ -689,6 +689,7 @@ discard block |
||
| 689 | 689 | * runs. Use this time to provide more settings for the task, e.g. from |
| 690 | 690 | * the collection's shared state, which is populated with the results |
| 691 | 691 | * of previous test runs. |
| 692 | + * @param \Closure $callback |
|
| 692 | 693 | */ |
| 693 | 694 | public function defer($task, $callback) |
| 694 | 695 | { |
@@ -711,7 +712,7 @@ discard block |
||
| 711 | 712 | |
| 712 | 713 | /** |
| 713 | 714 | * @param TaskInterface|NestedCollectionInterface|WrappedTaskInterface $task |
| 714 | - * @param $parentCollection |
|
| 715 | + * @param CollectionInterface $parentCollection |
|
| 715 | 716 | */ |
| 716 | 717 | protected function setParentCollectionForTask($task, $parentCollection) |
| 717 | 718 | { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $collection = $this; |
| 137 | 137 | $completionRegistrationTask = new CallableTask( |
| 138 | - function () use ($collection, $completionTask) { |
|
| 138 | + function() use ($collection, $completionTask) { |
|
| 139 | 139 | |
| 140 | 140 | $collection->registerCompletion($completionTask); |
| 141 | 141 | }, |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $context += ['name' => 'Progress']; |
| 179 | 179 | $context += TaskInfo::getTaskContext($this); |
| 180 | 180 | return $this->addCode( |
| 181 | - function () use ($level, $text, $context) { |
|
| 181 | + function() use ($level, $text, $context) { |
|
| 182 | 182 | $this->printTaskOutput($level, $text, $context); |
| 183 | 183 | } |
| 184 | 184 | ); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | { |
| 194 | 194 | $collection = $this; |
| 195 | 195 | $rollbackRegistrationTask = new CallableTask( |
| 196 | - function () use ($collection, $rollbackTask) { |
|
| 196 | + function() use ($collection, $rollbackTask) { |
|
| 197 | 197 | $collection->registerRollback($rollbackTask); |
| 198 | 198 | }, |
| 199 | 199 | $this |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | if ($task instanceof StackBasedTask) { |
| 247 | 247 | $task->stopOnFail(false); |
| 248 | 248 | } |
| 249 | - $ignoreErrorsInTask = function () use ($task) { |
|
| 249 | + $ignoreErrorsInTask = function() use ($task) { |
|
| 250 | 250 | $data = []; |
| 251 | 251 | try { |
| 252 | 252 | $result = $this->runSubtask($task); |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | { |
| 677 | 677 | return $this->defer( |
| 678 | 678 | $task, |
| 679 | - function ($task, $state) use ($functionName, $stateKey) { |
|
| 679 | + function($task, $state) use ($functionName, $stateKey) { |
|
| 680 | 680 | $fn = [$task, $functionName]; |
| 681 | 681 | $value = $state[$stateKey]; |
| 682 | 682 | $fn($value); |
@@ -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) { |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | ->completion($completion1) |
| 103 | 103 | ->rollbackCode(function() use($rollback1) { $rollback1->run(); } ) |
| 104 | 104 | ->completionCode(function() use($completion1) { $completion1->run(); } ) |
| 105 | - ->addCode(function () { return 42; }) |
|
| 105 | + ->addCode(function() { return 42; }) |
|
| 106 | 106 | ->progressMessage("not reached") |
| 107 | 107 | ->rollback($rollback2) |
| 108 | 108 | ->completion($completion2) |
| 109 | - ->addCode(function () { return 13; }); |
|
| 109 | + ->addCode(function() { return 13; }); |
|
| 110 | 110 | |
| 111 | 111 | $collection->setLogger($this->guy->logger()); |
| 112 | 112 | |
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | $result = $collection |
| 130 | 130 | ->addCode( |
| 131 | - function (ResultData $state) { |
|
| 131 | + function(ResultData $state) { |
|
| 132 | 132 | $state['one'] = 'first'; |
| 133 | 133 | }) |
| 134 | 134 | ->addCode( |
| 135 | - function (ResultData $state) { |
|
| 135 | + function(ResultData $state) { |
|
| 136 | 136 | $state['two'] = 'second'; |
| 137 | 137 | }) |
| 138 | 138 | ->addCode( |
| 139 | - function (ResultData $state) { |
|
| 139 | + function(ResultData $state) { |
|
| 140 | 140 | $state['three'] = "{$state['one']} and {$state['two']}"; |
| 141 | 141 | }) |
| 142 | 142 | ->run(); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | ->add($first) |
| 160 | 160 | ->add($second) |
| 161 | 161 | ->addCode( |
| 162 | - function (ResultData $state) { |
|
| 162 | + function(ResultData $state) { |
|
| 163 | 163 | $state['three'] = "{$state['one']} and {$state['two']}"; |
| 164 | 164 | }) |
| 165 | 165 | ->run(); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | ->add($third) |
| 188 | 188 | ->defer( |
| 189 | 189 | $third, |
| 190 | - function ($task, $state) { |
|
| 190 | + function($task, $state) { |
|
| 191 | 191 | $task->provideData('three', "{$state['one']} and {$state['two']}"); |
| 192 | 192 | } |
| 193 | 193 | ) |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | ->add($third) |
| 219 | 219 | ->defer( |
| 220 | 220 | $third, |
| 221 | - function ($task, $state) { |
|
| 221 | + function($task, $state) { |
|
| 222 | 222 | $task->provideData('three', "{$state['one']} and {$state['two']}"); |
| 223 | 223 | } |
| 224 | 224 | ) |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | use Robo\Result; |
| 10 | 10 | use Robo\ResultData; |
| 11 | -use Robo\Task\BaseTask; |
|
| 12 | 11 | use Robo\Collection\Collection; |
| 13 | 12 | use Robo\Task\ValueProviderTask; |
| 14 | 13 | use Robo\Task\CollectionTestTask; |
@@ -76,6 +76,10 @@ discard block |
||
| 76 | 76 | $this->resetState(); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | + /** |
|
| 80 | + * @param \League\Container\ContainerInterface $container |
|
| 81 | + * @param BuilderAwareInterface $commandFile |
|
| 82 | + */ |
|
| 79 | 83 | public static function create($container, $commandFile) |
| 80 | 84 | { |
| 81 | 85 | $builder = new self($commandFile); |
@@ -284,6 +288,9 @@ discard block |
||
| 284 | 288 | return $this->callCollectionStateFuntion(__FUNCTION__, func_get_args()); |
| 285 | 289 | } |
| 286 | 290 | |
| 291 | + /** |
|
| 292 | + * @param string $functionName |
|
| 293 | + */ |
|
| 287 | 294 | protected function callCollectionStateFuntion($functionName, $args) |
| 288 | 295 | { |
| 289 | 296 | $currentTask = ($this->currentTask instanceof WrappedTaskInterface) ? $this->currentTask->original() : $this->currentTask; |
@@ -3,10 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Robo\Robo; |
| 5 | 5 | use Robo\Collection\CollectionBuilder; |
| 6 | -use Robo\Task\ValueProviderTask; |
|
| 7 | - |
|
| 8 | 6 | use Symfony\Component\Console\Output\ConsoleOutput; |
| 9 | - |
|
| 10 | 7 | use League\Container\ContainerAwareInterface; |
| 11 | 8 | use League\Container\ContainerAwareTrait; |
| 12 | 9 | |