Completed
Pull Request — master (#924)
by Greg
02:07
created
src/Collection/Collection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                 $context += $this->getState()->getData();
183 183
                 $this->printTaskOutput($level, $text, $context);
184 184
             }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     {
195 195
         $collection = $this;
196 196
         $rollbackRegistrationTask = new CallableTask(
197
-            function () use ($collection, $rollbackTask) {
197
+            function() use ($collection, $rollbackTask) {
198 198
                 $collection->registerRollback($rollbackTask);
199 199
             },
200 200
             $this
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         if ($task instanceof StackBasedTask) {
248 248
             $task->stopOnFail(false);
249 249
         }
250
-        $ignoreErrorsInTask = function () use ($task) {
250
+        $ignoreErrorsInTask = function() use ($task) {
251 251
             $data = [];
252 252
             try {
253 253
                 $result = $this->runSubtask($task);
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
     {
680 680
         return $this->defer(
681 681
             $task,
682
-            function ($task, $state) use ($functionName, $stateKey) {
682
+            function($task, $state) use ($functionName, $stateKey) {
683 683
                 $fn = [$task, $functionName];
684 684
                 $value = $state[$stateKey];
685 685
                 $fn($value);
Please login to merge, or discard this patch.
tests/unit/Task/CollectionTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 )
Please login to merge, or discard this patch.
src/Task/Composer/RequireDependency.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Task/Development/SemVer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Common/ConfigAwareTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,9 +73,9 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Common/ProcessUtils.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public static function escapeArgument($argument)
36 36
     {
37
-        @trigger_error('The '.__METHOD__.'() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0.', E_USER_DEPRECATED);
37
+        @trigger_error('The ' . __METHOD__ . '() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0.', E_USER_DEPRECATED);
38 38
 
39 39
         //Fix for PHP bug #43784 escapeshellarg removes % from given string
40 40
         //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                     $escapedArgument .= '\\"';
53 53
                 } elseif (self::isSurroundedBy($part, '%')) {
54 54
                     // Avoid environment variable expansion
55
-                    $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%';
55
+                    $escapedArgument .= '^%"' . substr($part, 1, -1) . '"^%';
56 56
                 } else {
57 57
                     // escape trailing backslash
58 58
                     if ('\\' === substr($part, -1)) {
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
                 }
64 64
             }
65 65
             if ($quote) {
66
-                $escapedArgument = '"'.$escapedArgument.'"';
66
+                $escapedArgument = '"' . $escapedArgument . '"';
67 67
             }
68 68
 
69 69
             return $escapedArgument;
70 70
         }
71 71
 
72
-        return "'".str_replace("'", "'\\''", $argument)."'";
72
+        return "'" . str_replace("'", "'\\''", $argument) . "'";
73 73
     }
74 74
 
75 75
     private static function isSurroundedBy($arg, $char)
Please login to merge, or discard this patch.
tests/cli/ForEachCest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
         $I->wantTo('set iterable in the __constructor');
42 42
         $I
43 43
             ->taskForEach($example['items'])
44
-            ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) {
45
-                $builder->addCode(function () use ($key, $value, &$actual) {
44
+            ->withBuilder(function(CollectionBuilder $builder, $key, $value) use (&$actual) {
45
+                $builder->addCode(function() use ($key, $value, &$actual) {
46 46
                     $actual[] = "$key = $value";
47 47
 
48 48
                     return 0;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $I->wantTo('set iterable with deferTaskConfiguration()');
64 64
         $I
65 65
             ->collectionBuilder()
66
-            ->addCode(function (Data $data) use ($example) {
66
+            ->addCode(function(Data $data) use ($example) {
67 67
                 $data['items'] = $example['items'];
68 68
 
69 69
                 return 0;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
                 $I
73 73
                     ->taskForEach()
74 74
                     ->deferTaskConfiguration('setIterable', 'items')
75
-                    ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) {
76
-                        $builder->addCode(function () use ($key, $value, &$actual) {
75
+                    ->withBuilder(function(CollectionBuilder $builder, $key, $value) use (&$actual) {
76
+                        $builder->addCode(function() use ($key, $value, &$actual) {
77 77
                             $actual[] = "$key = $value";
78 78
 
79 79
                             return 0;
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
         $I->wantTo('call the __constructor() without argument');
92 92
         $I
93 93
             ->taskForEach()
94
-            ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) {
95
-                $builder->addCode(function () use ($key, $value, &$actual) {
94
+            ->withBuilder(function(CollectionBuilder $builder, $key, $value) use (&$actual) {
95
+                $builder->addCode(function() use ($key, $value, &$actual) {
96 96
                     $actual++;
97 97
 
98 98
                     return 0;
Please login to merge, or discard this patch.
src/ClassDiscovery/RelativeNamespaceDiscovery.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
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) {
57
-                return $directory.$relativePath;
56
+            $directories = array_filter(array_map(function($directory) use ($relativePath) {
57
+                return $directory . $relativePath;
58 58
             }, $directories), 'is_dir');
59 59
 
60 60
             if ($directories) {
61 61
                 foreach ($this->search($directories, $this->searchPattern) as $file) {
62 62
                     $relativePathName = $file->getRelativePathname();
63
-                    $classes[] = $baseNamespace.$this->convertPathToNamespace($relativePath.'/'.$relativePathName);
63
+                    $classes[] = $baseNamespace . $this->convertPathToNamespace($relativePath . '/' . $relativePathName);
64 64
                 }
65 65
             }
66 66
         }
@@ -107,6 +107,6 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function convertNamespaceToPath($namespace)
109 109
     {
110
-        return '/'.str_replace("\\", '/', trim($namespace, '\\'));
110
+        return '/' . str_replace("\\", '/', trim($namespace, '\\'));
111 111
     }
112 112
 }
Please login to merge, or discard this patch.
examples/src/Robo/Plugin/Commands/ExampleCommands.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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");
Please login to merge, or discard this patch.