@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Suilven\PHPTravisEnhancer\Terminal; |
4 | 4 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | |
3 | 3 | namespace Suilven\PHPTravisEnhancer\Runner; |
4 | 4 |