@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Robo\Robo; |
| 10 | 10 | use Robo\Result; |
| 11 | 11 | use Robo\State\Data; |
| 12 | -use Robo\Task\BaseTask; |
|
| 13 | 12 | use Robo\Collection\Collection; |
| 14 | 13 | use Robo\Task\ValueProviderTask; |
| 15 | 14 | use Robo\Task\CollectionTestTask; |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | ->completion($completion1) |
| 111 | 111 | ->rollbackCode(function() use($rollback1) { $rollback1->run(); } ) |
| 112 | 112 | ->completionCode(function() use($completion1) { $completion1->run(); } ) |
| 113 | - ->addCode(function () { return 42; }) |
|
| 113 | + ->addCode(function() { return 42; }) |
|
| 114 | 114 | ->progressMessage("not reached") |
| 115 | 115 | ->rollback($rollback2) |
| 116 | 116 | ->completion($completion2) |
| 117 | - ->addCode(function () { return 13; }); |
|
| 117 | + ->addCode(function() { return 13; }); |
|
| 118 | 118 | |
| 119 | 119 | $collection->setLogger($this->guy->logger()); |
| 120 | 120 | |
@@ -137,15 +137,15 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | $result = $collection |
| 139 | 139 | ->addCode( |
| 140 | - function (Data $state) { |
|
| 140 | + function(Data $state) { |
|
| 141 | 141 | $state['one'] = 'first'; |
| 142 | 142 | }) |
| 143 | 143 | ->addCode( |
| 144 | - function (Data $state) { |
|
| 144 | + function(Data $state) { |
|
| 145 | 145 | $state['two'] = 'second'; |
| 146 | 146 | }) |
| 147 | 147 | ->addCode( |
| 148 | - function (Data $state) { |
|
| 148 | + function(Data $state) { |
|
| 149 | 149 | $state['three'] = "{$state['one']} and {$state['two']}"; |
| 150 | 150 | }) |
| 151 | 151 | ->run(); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | ->add($first) |
| 170 | 170 | ->add($second) |
| 171 | 171 | ->addCode( |
| 172 | - function (Data $state) { |
|
| 172 | + function(Data $state) { |
|
| 173 | 173 | $state['three'] = "{$state['one']} and {$state['two']}"; |
| 174 | 174 | }) |
| 175 | 175 | ->run(); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | ->add($third) |
| 199 | 199 | ->defer( |
| 200 | 200 | $third, |
| 201 | - function ($task, $state) { |
|
| 201 | + function($task, $state) { |
|
| 202 | 202 | $task->provideData('three', "{$state['one']} and {$state['two']}"); |
| 203 | 203 | } |
| 204 | 204 | ) |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | ->add($third) |
| 231 | 231 | ->defer( |
| 232 | 232 | $third, |
| 233 | - function ($task, $state) { |
|
| 233 | + function($task, $state) { |
|
| 234 | 234 | $task->provideData('three', "{$state['one']} and {$state['two']}"); |
| 235 | 235 | } |
| 236 | 236 | ) |
@@ -1,6 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use AspectMock\Test as test; |
| 3 | - |
|
| 4 | 3 | use Robo\Traits\Common\AdjustQuotes; |
| 5 | 4 | |
| 6 | 5 | class ComposerTest extends \Codeception\TestCase\Test |
@@ -1,6 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use AspectMock\Test as test; |
| 3 | - |
|
| 4 | 3 | use Robo\Traits\Common\AdjustQuotes; |
| 5 | 4 | |
| 6 | 5 | class GulpTest extends \Codeception\TestCase\Test |
@@ -24,32 +24,32 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $this->assertEquals( |
| 26 | 26 | $this->adjustQuotes("gulp 'default'"), |
| 27 | - (new \Robo\Task\Gulp\Run('default','gulp'))->getCommand() |
|
| 27 | + (new \Robo\Task\Gulp\Run('default', 'gulp'))->getCommand() |
|
| 28 | 28 | ); |
| 29 | 29 | |
| 30 | 30 | $this->assertEquals( |
| 31 | 31 | $this->adjustQuotes("gulp 'another'"), |
| 32 | - (new \Robo\Task\Gulp\Run('another','gulp'))->getCommand() |
|
| 32 | + (new \Robo\Task\Gulp\Run('another', 'gulp'))->getCommand() |
|
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | $this->assertEquals( |
| 36 | 36 | $this->adjustQuotes("gulp 'default' --silent"), |
| 37 | - (new \Robo\Task\Gulp\Run('default','gulp'))->silent()->getCommand() |
|
| 37 | + (new \Robo\Task\Gulp\Run('default', 'gulp'))->silent()->getCommand() |
|
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | $this->assertEquals( |
| 41 | 41 | $this->adjustQuotes("gulp 'default' --no-color"), |
| 42 | - (new \Robo\Task\Gulp\Run('default','gulp'))->noColor()->getCommand() |
|
| 42 | + (new \Robo\Task\Gulp\Run('default', 'gulp'))->noColor()->getCommand() |
|
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | 45 | $this->assertEquals( |
| 46 | 46 | $this->adjustQuotes("gulp 'default' --color"), |
| 47 | - (new \Robo\Task\Gulp\Run('default','gulp'))->color()->getCommand() |
|
| 47 | + (new \Robo\Task\Gulp\Run('default', 'gulp'))->color()->getCommand() |
|
| 48 | 48 | ); |
| 49 | 49 | |
| 50 | 50 | $this->assertEquals( |
| 51 | 51 | $this->adjustQuotes("gulp 'default' --tasks-simple"), |
| 52 | - (new \Robo\Task\Gulp\Run('default','gulp'))->simple()->getCommand() |
|
| 52 | + (new \Robo\Task\Gulp\Run('default', 'gulp'))->simple()->getCommand() |
|
| 53 | 53 | ); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $gulp = test::double('Robo\Task\Gulp\Run', ['executeCommand' => null, 'getConfig' => new \Robo\Config(), 'logger' => new \Psr\Log\NullLogger()]); |
| 59 | 59 | |
| 60 | - $task = (new \Robo\Task\Gulp\Run('default','gulp'))->simple(); |
|
| 60 | + $task = (new \Robo\Task\Gulp\Run('default', 'gulp'))->simple(); |
|
| 61 | 61 | $this->assertEquals( |
| 62 | 62 | $this->adjustQuotes("gulp 'default' --tasks-simple"), |
| 63 | 63 | $task->getCommand()); |
@@ -69,12 +69,11 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | $isWindows = defined('PHP_WINDOWS_VERSION_MAJOR'); |
| 71 | 71 | $expected = $isWindows ? |
| 72 | - 'gulp "anotherWith weired!(\"\') Chars"' : |
|
| 73 | - "gulp 'anotherWith weired!(\"'\\'') Chars'"; |
|
| 72 | + 'gulp "anotherWith weired!(\"\') Chars"' : "gulp 'anotherWith weired!(\"'\\'') Chars'"; |
|
| 74 | 73 | |
| 75 | 74 | $this->assertEquals( |
| 76 | 75 | $expected, |
| 77 | - (new \Robo\Task\Gulp\Run('anotherWith weired!("\') Chars','gulp'))->getCommand() |
|
| 76 | + (new \Robo\Task\Gulp\Run('anotherWith weired!("\') Chars', 'gulp'))->getCommand() |
|
| 78 | 77 | ); |
| 79 | 78 | } |
| 80 | 79 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | if (isset($version)) { |
| 30 | 30 | $project = array_map( |
| 31 | - function ($item) use ($version) { |
|
| 31 | + function($item) use ($version) { |
|
| 32 | 32 | return "$item:$version"; |
| 33 | 33 | }, |
| 34 | 34 | $project |
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | $this->version = array_intersect_key($matches, $this->version); |
| 238 | - $this->version = array_map(function ($item) { |
|
| 238 | + $this->version = array_map(function($item) { |
|
| 239 | 239 | return $item[0]; |
| 240 | 240 | }, $this->version); |
| 241 | 241 | } |
@@ -73,9 +73,9 @@ |
||
| 73 | 73 | */ |
| 74 | 74 | private static function getClassKey($key) |
| 75 | 75 | { |
| 76 | - $configPrefix = static::configPrefix(); // task. |
|
| 77 | - $configClass = static::configClassIdentifier(get_called_class()); // PARTIAL_NAMESPACE.CLASSNAME |
|
| 78 | - $configPostFix = static::configPostfix(); // .settings |
|
| 76 | + $configPrefix = static::configPrefix(); // task. |
|
| 77 | + $configClass = static::configClassIdentifier(get_called_class()); // PARTIAL_NAMESPACE.CLASSNAME |
|
| 78 | + $configPostFix = static::configPostfix(); // .settings |
|
| 79 | 79 | |
| 80 | 80 | return sprintf('%s%s%s.%s', $configPrefix, $configClass, $configPostFix, $key); |
| 81 | 81 | } |
@@ -1,6 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Robo\Robo; |
| 3 | - |
|
| 4 | 3 | use Consolidation\Config\Loader\ConfigProcessor; |
| 5 | 4 | use Consolidation\Config\Loader\YamlConfigLoader; |
| 6 | 5 | |
@@ -7,8 +7,6 @@ |
||
| 7 | 7 | |
| 8 | 8 | namespace Robo\Common; |
| 9 | 9 | |
| 10 | -use Symfony\Component\Process\Exception\InvalidArgumentException; |
|
| 11 | - |
|
| 12 | 10 | /** |
| 13 | 11 | * ProcessUtils is a bunch of utility methods. We want to allow Robo 1.x |
| 14 | 12 | * to work with Symfony 4.x while remaining backwards compatibility. This |
@@ -74,6 +74,9 @@ |
||
| 74 | 74 | return "'" . str_replace("'", "'\\''", $argument) . "'"; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @param string $char |
|
| 79 | + */ |
|
| 77 | 80 | private static function isSurroundedBy($arg, $char) |
| 78 | 81 | { |
| 79 | 82 | return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; |
@@ -91,8 +91,8 @@ |
||
| 91 | 91 | { |
| 92 | 92 | $finder = new Finder(); |
| 93 | 93 | $finder->files() |
| 94 | - ->name($pattern) |
|
| 95 | - ->in($directories); |
|
| 94 | + ->name($pattern) |
|
| 95 | + ->in($directories); |
|
| 96 | 96 | |
| 97 | 97 | return $finder; |
| 98 | 98 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $relativePath = $this->convertNamespaceToPath($this->relativeNamespace); |
| 54 | 54 | |
| 55 | 55 | foreach ($this->classLoader->getPrefixesPsr4() as $baseNamespace => $directories) { |
| 56 | - $directories = array_filter(array_map(function ($directory) use ($relativePath) { |
|
| 56 | + $directories = array_filter(array_map(function($directory) use ($relativePath) { |
|
| 57 | 57 | return $directory . $relativePath; |
| 58 | 58 | }, $directories), 'is_dir'); |
| 59 | 59 | |