Passed
Push — master ( c10d80...ca58b5 )
by Gordon
03:41 queued 01:47
created
src/IFace/Task.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\IFace;
4 4
 
Please login to merge, or discard this patch.
src/Helper/TravisYMLHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Helper;
4 4
 
@@ -34,15 +34,15 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $pathParts = \explode('/', $path);
36 36
         $part = \array_shift($pathParts);
37
-        if (!isset($yamlAsArray[$part])) {
38
-            $yamlAsArray[$part] = [];
37
+        if (!isset($yamlAsArray[ $part ])) {
38
+            $yamlAsArray[ $part ] = [ ];
39 39
         }
40 40
         $remainingPath = \implode('/', $pathParts);
41 41
         if (\sizeof($pathParts) === 0) {
42 42
             return;
43 43
         }
44 44
 
45
-        $this->ensurePathExistsInYaml($yamlAsArray[$part], $remainingPath);
45
+        $this->ensurePathExistsInYaml($yamlAsArray[ $part ], $remainingPath);
46 46
     }
47 47
 
48 48
 
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
     public function checkForExistingInEnv(array $yamlAsArray, string $flag): bool
59 59
     {
60 60
         $foundExisting = false;
61
-        foreach ($yamlAsArray['matrix']['include'] as $entry) {
62
-            $env = $entry['env'];
61
+        foreach ($yamlAsArray[ 'matrix' ][ 'include' ] as $entry) {
62
+            $env = $entry[ 'env' ];
63 63
             if ($env !== ($flag . '=1')) {
64 64
                 continue;
65 65
             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function loadTravis(): array
81 81
     {
82
-        $result = [];
82
+        $result = [ ];
83 83
         $path = \getcwd() . '/' . $this->travisFileName;
84 84
         if (\file_exists($this->travisFileName)) {
85 85
             $result = Yaml::parseFile($path);
Please login to merge, or discard this patch.
src/Task/AddPHPCSTask.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Task;
4 4
 
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
     /** @return array<string> */
46 46
     public function getComposerPackages(): array
47 47
     {
48
-        return ['slevomat/coding-standard'];
48
+        return [ 'slevomat/coding-standard' ];
49 49
     }
50 50
 
51 51
 
52 52
     /** @return array<string, string> */
53 53
     public function filesToCopy(): array
54 54
     {
55
-        return ['files/ruleset.xml' => 'ruleset.xml'];
55
+        return [ 'files/ruleset.xml' => 'ruleset.xml' ];
56 56
     }
57 57
 
58 58
 
Please login to merge, or discard this patch.
src/Task/AddPHPLintTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Task;
4 4
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
     /** @return array<string,string> */
36 36
     public function getComposerScripts(): array
37 37
     {
38
-        return ["lint" => "vendor/bin/parallel-lint src/ tests/",];
38
+        return [ "lint" => "vendor/bin/parallel-lint src/ tests/", ];
39 39
     }
40 40
 
41 41
 
42 42
     /** @return array<string> */
43 43
     public function getComposerPackages(): array
44 44
     {
45
-        return ['php-parallel-lint/php-parallel-lint', 'php-parallel-lint/php-console-highlighter'];
45
+        return [ 'php-parallel-lint/php-parallel-lint', 'php-parallel-lint/php-console-highlighter' ];
46 46
     }
47 47
 
48 48
 
49 49
     /** @return array<string, string> */
50 50
     public function filesToCopy(): array
51 51
     {
52
-        return [];
52
+        return [ ];
53 53
     }
54 54
 
55 55
 
Please login to merge, or discard this patch.
src/Task/AddPsalmTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Task;
4 4
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
     /** @return array<string,string> */
36 36
     public function getComposerScripts(): array
37 37
     {
38
-        return ["psalm" =>"vendor/bin/psalm --show-info=true"];
38
+        return [ "psalm" =>"vendor/bin/psalm --show-info=true" ];
39 39
     }
40 40
 
41 41
 
42 42
     /** @return array<string> */
43 43
     public function getComposerPackages(): array
44 44
     {
45
-        return ['vimeo/psalm'];
45
+        return [ 'vimeo/psalm' ];
46 46
     }
47 47
 
48 48
 
49 49
     /** @return array<string, string> */
50 50
     public function filesToCopy(): array
51 51
     {
52
-        return [];
52
+        return [ ];
53 53
     }
54 54
 
55 55
 
Please login to merge, or discard this patch.
src/Task/AddPHPStanTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Task;
4 4
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
     /** @return array<string,string> */
36 36
     public function getComposerScripts(): array
37 37
     {
38
-        return ["phpstan" => "vendor/bin/phpstan analyse --level=6 -c tests/phpstan.neon src/"];
38
+        return [ "phpstan" => "vendor/bin/phpstan analyse --level=6 -c tests/phpstan.neon src/" ];
39 39
     }
40 40
 
41 41
 
42 42
     /** @return array<string> */
43 43
     public function getComposerPackages(): array
44 44
     {
45
-        return ['phpstan/phpstan-strict-rules', 'phpstan/extension-installer'];
45
+        return [ 'phpstan/phpstan-strict-rules', 'phpstan/extension-installer' ];
46 46
     }
47 47
 
48 48
 
49 49
     /** @return array<string, string> */
50 50
     public function filesToCopy(): array
51 51
     {
52
-        return ['files/phpstan.neon' => 'TESTS_DIR/phpstan.neon'];
52
+        return [ 'files/phpstan.neon' => 'TESTS_DIR/phpstan.neon' ];
53 53
     }
54 54
 
55 55
 
Please login to merge, or discard this patch.
src/Task/AddDuplicationCheckTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Task;
4 4
 
@@ -37,21 +37,21 @@  discard block
 block discarded – undo
37 37
     /** @return array<string,string> this command is only run within Travis, as it requires node installed */
38 38
     public function getComposerScripts(): array
39 39
     {
40
-        return [];
40
+        return [ ];
41 41
     }
42 42
 
43 43
 
44 44
     /** @return array<string> */
45 45
     public function getComposerPackages(): array
46 46
     {
47
-        return [];
47
+        return [ ];
48 48
     }
49 49
 
50 50
 
51 51
     /** @return array<string, string> */
52 52
     public function filesToCopy(): array
53 53
     {
54
-        return [];
54
+        return [ ];
55 55
     }
56 56
 
57 57
 
Please login to merge, or discard this patch.
src/Abstraction/TaskBase.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Abstraction;
4 4
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     private $climate;
17 17
 
18 18
     /** @var array<string> The names of the commands, e.g. phpstan, phpcs */
19
-    private static $codeCheckCommands = [];
19
+    private static $codeCheckCommands = [ ];
20 20
 
21 21
     abstract public function getFlag(): string;
22 22
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $foundExisting = $helper->checkForExistingInEnv($yamlAsArray, $this->getFlag());
68 68
         if (!$foundExisting) {
69 69
             // add a matrix entry
70
-            $yamlAsArray['matrix']['include'][] = [
70
+            $yamlAsArray[ 'matrix' ][ 'include' ][ ] = [
71 71
                 'php' => 7.4,
72 72
                 'env' => $this->getFlag() . '=1',
73 73
             ];
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
             $this->taskReport('Added env option: ' . $this->getFlag() . '=1');
76 76
 
77 77
             /** @var string $prefix the bash prefix to check for the flag being set */
78
-            $prefix = 'if [[ $' . $this->getFlag() .' ]]; then ';
78
+            $prefix = 'if [[ $' . $this->getFlag() . ' ]]; then ';
79 79
 
80 80
             $beforeScript = $this->getTravisBeforeScript();
81 81
             if (isset($beforeScript)) {
82 82
                 // install jdscpd, node tool, for duplication detection
83 83
                 $helper->ensurePathExistsInYaml($yamlAsArray, 'before_script');
84
-                $yamlAsArray['before_script'][] = $prefix . $beforeScript . '  ;fi';
84
+                $yamlAsArray[ 'before_script' ][ ] = $prefix . $beforeScript . '  ;fi';
85 85
                 $this->taskReport('Added before script: ' . $beforeScript);
86 86
             }
87 87
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             if (isset($script)) {
90 90
                 // run jscpd on src and tests dir
91 91
                 $helper->ensurePathExistsInYaml($yamlAsArray, 'script');
92
-                $yamlAsArray['script'][] = $prefix . $script . ' ; fi';
92
+                $yamlAsArray[ 'script' ][ ] = $prefix . $script . ' ; fi';
93 93
                 $this->taskReport('Added script: ' . $script);
94 94
             }
95 95
         }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         if (\sizeof($packages) > 0) {
144 144
             foreach ($packages as $package) {
145 145
                 $cmd = 'composer --verbose --profile require --dev ' . $package;
146
-                $output = [];
146
+                $output = [ ];
147 147
                 \exec($cmd, $output, $retVal);
148 148
                 $this->taskReport('Installing ' . $package, $retVal);
149 149
             }
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
         $composerFile = \getcwd() . '/composer.json';
159 159
         $contents = \file_get_contents($composerFile);
160 160
         $json = \json_decode($contents, true);
161
-        if (!isset($json['scripts'])) {
162
-            $json['scripts'] = [];
161
+        if (!isset($json[ 'scripts' ])) {
162
+            $json[ 'scripts' ] = [ ];
163 163
         }
164
-        $scriptsInJSON = $json['scripts'];
164
+        $scriptsInJSON = $json[ 'scripts' ];
165 165
         $existingScriptNames = \array_keys($scriptsInJSON);
166 166
         \error_log(\print_r($existingScriptNames, true));
167 167
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         foreach ($scripts as $scriptName => $bashCode) {
177 177
             $this->climate->out('Adding script ' . $scriptName . ' --> ' . $bashCode);
178 178
             if (!\in_array($scriptName, $existingScriptNames, true)) {
179
-                $scriptsInJSON[$scriptName] = $bashCode;
179
+                $scriptsInJSON[ $scriptName ] = $bashCode;
180 180
                 ;
181 181
             } else {
182 182
                 $this->climate->error('Script ' . $scriptName . ' already exists');
@@ -185,12 +185,12 @@  discard block
 block discarded – undo
185 185
                 continue;
186 186
             }
187 187
 
188
-            self::$codeCheckCommands[] = 'composer ' . $scriptName;
188
+            self::$codeCheckCommands[ ] = 'composer ' . $scriptName;
189 189
         }
190 190
 
191
-        $scriptsInJSON['checkCode'] = \implode(' && ', self::$codeCheckCommands);
191
+        $scriptsInJSON[ 'checkCode' ] = \implode(' && ', self::$codeCheckCommands);
192 192
 
193
-        $json['scripts'] = $scriptsInJSON;
193
+        $json[ 'scripts' ] = $scriptsInJSON;
194 194
         $contents = \json_encode($json, \JSON_PRETTY_PRINT);
195 195
         \file_put_contents($composerFile, $contents);
196 196
     }
Please login to merge, or discard this patch.
src/Terminal/TerminalHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Suilven\PHPTravisEnhancer\Terminal;
4 4
 
Please login to merge, or discard this patch.