Completed
Pull Request — master (#924)
by Greg
02:07
created
tests/unit/Task/SemVerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     public function testSemverParseFileWithWindowsLineEndings()
52 52
     {
53 53
         $fixturePath = tempnam(sys_get_temp_dir(), 'semver');
54
-        $semverFile = str_replace("\n", "\r\n", file_get_contents(codecept_data_dir().'.semver'));
54
+        $semverFile = str_replace("\n", "\r\n", file_get_contents(codecept_data_dir() . '.semver'));
55 55
         file_put_contents($fixturePath, $semverFile);
56 56
 
57 57
         $res = (new \Robo\Task\Development\SemVer($fixturePath))
Please login to merge, or discard this patch.
tests/cli/CollectionCest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function _before(CliGuy $I)
12 12
     {
13
-        $I->amInPath(codecept_data_dir().'sandbox');
13
+        $I->amInPath(codecept_data_dir() . 'sandbox');
14 14
     }
15 15
 
16 16
     public function toRunMultipleTasksViaACollectionBuilder(CliGuy $I)
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             ->rollback(
123 123
                 $I->taskDeleteDir('j')
124 124
             )
125
-            ->rollbackCode(function () {
125
+            ->rollbackCode(function() {
126 126
                 throw new AbortTasksException('Aborting rollback.');
127 127
             })
128 128
             ->taskFilesystemStack()
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                 ->mkdir('stuff')
182 182
             ->taskForEach($processList)
183 183
                 ->withBuilder(
184
-                    function ($builder, $key, $value) {
184
+                    function($builder, $key, $value) {
185 185
                         return $builder
186 186
                             ->taskFilesystemStack()
187 187
                                 ->touch("stuff/{$value}.txt");
@@ -238,32 +238,32 @@  discard block
 block discarded – undo
238 238
 
239 239
     public function toRollbackInCorrectOrder(CliGuy $I)
240 240
     {
241
-        $expected_order = [6,5,4,3,2,1];
241
+        $expected_order = [6, 5, 4, 3, 2, 1];
242 242
         $actual_order = [];
243 243
         $collection = $I->collectionBuilder();
244
-        $collection->rollbackCode(function () use (&$actual_order) {
244
+        $collection->rollbackCode(function() use (&$actual_order) {
245 245
             $actual_order[] = 1;
246 246
         });
247
-        $collection->rollbackCode(function () use (&$actual_order) {
247
+        $collection->rollbackCode(function() use (&$actual_order) {
248 248
             $actual_order[] = 2;
249 249
         });
250
-        $collection->rollbackCode(function () use (&$actual_order) {
250
+        $collection->rollbackCode(function() use (&$actual_order) {
251 251
             $actual_order[] = 3;
252 252
         });
253 253
         // Add a nested collection with rollbacks.
254 254
         $nested_collection = $I->collectionBuilder();
255
-        $nested_collection->rollbackCode(function () use (&$actual_order) {
255
+        $nested_collection->rollbackCode(function() use (&$actual_order) {
256 256
             $actual_order[] = 4;
257 257
         });
258
-        $nested_collection->rollbackCode(function () use (&$actual_order) {
258
+        $nested_collection->rollbackCode(function() use (&$actual_order) {
259 259
             $actual_order[] = 5;
260 260
         });
261 261
         $collection->addTask($nested_collection);
262 262
 
263
-        $collection->rollbackCode(function () use (&$actual_order) {
263
+        $collection->rollbackCode(function() use (&$actual_order) {
264 264
             $actual_order[] = 6;
265 265
         });
266
-        $collection->addCode(function () {
266
+        $collection->addCode(function() {
267 267
             return Result::EXITCODE_ERROR;
268 268
         });
269 269
         $result = $collection->run();
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
         $collection = $I->getContainer()->get('collection');
464 464
 
465 465
         $collection->addCode(
466
-            function () {
466
+            function() {
467 467
                 throw new \RuntimeException('Error');
468 468
             }
469 469
         );
Please login to merge, or discard this patch.
src/Runner.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public function __construct($roboClass = null, $roboFile = null)
81 81
     {
82 82
         // set the const as class properties to allow overwriting in child classes
83
-        $this->roboClass = $roboClass ? $roboClass : self::ROBOCLASS ;
83
+        $this->roboClass = $roboClass ? $roboClass : self::ROBOCLASS;
84 84
         $this->roboFile  = $roboFile ? $roboFile : self::ROBOFILE;
85 85
         $this->dir = getcwd();
86 86
     }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     {
280 280
         /** @var \Robo\ClassDiscovery\RelativeNamespaceDiscovery $discovery */
281 281
         $discovery = Robo::service('relativeNamespaceDiscovery');
282
-        $discovery->setRelativeNamespace($relativeNamespace.'\Commands')
282
+        $discovery->setRelativeNamespace($relativeNamespace . '\Commands')
283 283
             ->setSearchPattern('/.*Commands?\.php$/');
284 284
         return $discovery->getClasses();
285 285
     }
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
 
461 461
         if (substr($argv[$pos], 0, 12) == '--load-from=') {
462 462
             $this->dir = substr($argv[$pos], 12);
463
-        } elseif (isset($argv[$pos +1])) {
464
-            $this->dir = $argv[$pos +1];
465
-            unset($argv[$pos +1]);
463
+        } elseif (isset($argv[$pos + 1])) {
464
+            $this->dir = $argv[$pos + 1];
465
+            unset($argv[$pos + 1]);
466 466
         }
467 467
         unset($argv[$pos]);
468 468
         // Make adjustments if '--load-from' points at a file.
Please login to merge, or discard this patch.
tests/unit/ClassDiscovery/RelativeNamespaceDiscoveryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public function testGetClasses()
12 12
     {
13 13
         $classLoader = new ClassLoader();
14
-        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__.'/../../plugins')]);
14
+        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__ . '/../../plugins')]);
15 15
         $service = new RelativeNamespaceDiscovery($classLoader);
16 16
         $service->setRelativeNamespace('Robo\Plugin');
17 17
         $service->setSearchPattern('/.*Commands?\.php$/');
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function testGetFile()
27 27
     {
28 28
         $classLoader = new ClassLoader();
29
-        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__.'/../../plugins')]);
29
+        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__ . '/../../plugins')]);
30 30
         $service = new RelativeNamespaceDiscovery($classLoader);
31 31
         $service->setRelativeNamespace('Robo\Plugin');
32 32
 
Please login to merge, or discard this patch.
tests/_bootstrap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
     'debug' => true,
7 7
     'cacheDir' => '/tmp',
8 8
     'includePaths' => [
9
-        __DIR__.'/../src',
10
-        __DIR__.'/../vendor/symfony/process',
11
-        __DIR__.'/../vendor/symfony/console',
12
-        __DIR__.'/../vendor/henrikbjorn/lurker/src',
9
+        __DIR__ . '/../src',
10
+        __DIR__ . '/../vendor/symfony/process',
11
+        __DIR__ . '/../vendor/symfony/console',
12
+        __DIR__ . '/../vendor/henrikbjorn/lurker/src',
13 13
     ]
14 14
 ]);
Please login to merge, or discard this patch.
tests/unit/Task/GulpTest.php 1 patch
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,32 +24,32 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
tests/src/Fixtures.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
     public function mktmpdir($basedir = false)
48 48
     {
49
-        $tempfile = tempnam($basedir ?: $this->testDir ?: sys_get_temp_dir(),'robo-tests');
49
+        $tempfile = tempnam($basedir ?: $this->testDir ?: sys_get_temp_dir(), 'robo-tests');
50 50
         unlink($tempfile);
51 51
         mkdir($tempfile);
52 52
         $this->tmpDirs[] = $tempfile;
Please login to merge, or discard this patch.
tests/functional/FlattenDirTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         $this->fixtures->createAndCdToSandbox();
45 45
 
46 46
         $result = $this->taskFlattenDir('some/deeply/nested/*.re')
47
-            ->includeParents([1,1])
47
+            ->includeParents([1, 1])
48 48
             ->parentDir('some')
49 49
             ->to('flattened')
50 50
             ->run();
Please login to merge, or discard this patch.
tests/functional/ExecTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $task = $this->taskExec('env | wc -l')->interactive(false);
69 69
         $result = $task->run();
70 70
         $this->assertTrue($result->wasSuccessful());
71
-        $start_count = (int) $result->getMessage();
71
+        $start_count = (int)$result->getMessage();
72 72
         $this->assertGreaterThan(0, $start_count);
73 73
 
74 74
         // Verify that we get the same amount of environment variables with
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->assertTrue($result->wasSuccessful());
79 79
         $this->assertEquals(
80 80
             $start_count,
81
-            (int) $result->getMessage());
81
+            (int)$result->getMessage());
82 82
 
83 83
         // Now run the same command, but this time add another environment
84 84
         // variable, and see if our count increases by one.
@@ -86,6 +86,6 @@  discard block
 block discarded – undo
86 86
         $task->env('FOO', 'BAR');
87 87
         $result = $task->run();
88 88
         $this->assertTrue($result->wasSuccessful());
89
-        $this->assertEquals($start_count + 1, (int) $result->getMessage());
89
+        $this->assertEquals($start_count + 1, (int)$result->getMessage());
90 90
     }
91 91
 }
Please login to merge, or discard this patch.