Completed
Branch master (a69c65)
by Greg
04:32
created
examples/RoboFile.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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");
Please login to merge, or discard this patch.
RoboFile.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,5 @@
 block discarded – undo
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
 {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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']);
Please login to merge, or discard this patch.
src/Collection/Collection.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -11,9 +11,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Collection/CollectionBuilder.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Collection/Temporary.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Common/TaskIO.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Log/ResultPrinter.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,13 +2,10 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Result.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Robo.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
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
                     }
Please login to merge, or discard this patch.