@@ -135,6 +135,9 @@ |
||
| 135 | 135 | return $reformattedParams; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $directory |
|
| 140 | + */ |
|
| 138 | 141 | public function getConfigFiles($directory): array |
| 139 | 142 | { |
| 140 | 143 | return (new ConfigFileFinder())->discoverFiles($directory); |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | { |
| 79 | 79 | $scripts = $this->getAllScripts(); |
| 80 | 80 | |
| 81 | - return array_filter($scripts, function ($key) use ($query) { |
|
| 81 | + return array_filter($scripts, function($key) use ($query) { |
|
| 82 | 82 | return strpos($key, $query) > -1 || levenshtein($key, $query) < 3; |
| 83 | 83 | }, ARRAY_FILTER_USE_KEY); |
| 84 | 84 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | { |
| 211 | 211 | $countConfigFiles = count($configFiles); |
| 212 | 212 | for ($i = 0; $i < $countConfigFiles; $i++) { |
| 213 | - $configFiles[$i] = str_replace($this->rootDirectory."/", "", $configFiles[$i]); |
|
| 213 | + $configFiles[$i] = str_replace($this->rootDirectory . "/", "", $configFiles[$i]); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | if (count($configFiles) == 1) { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | $scripts = $scriptFinder->getAllScripts(); |
| 248 | 248 | |
| 249 | - $commands = array_map(function (Script $script) { |
|
| 249 | + $commands = array_map(function(Script $script) { |
|
| 250 | 250 | return $script->getName(); |
| 251 | 251 | }, $scripts); |
| 252 | 252 | |
@@ -48,19 +48,19 @@ |
||
| 48 | 48 | return $globResult; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $overrideFiles = array_filter($globResult, function (string $file) { |
|
| 51 | + $overrideFiles = array_filter($globResult, function(string $file) { |
|
| 52 | 52 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
| 53 | 53 | |
| 54 | 54 | return $extension === 'override'; |
| 55 | 55 | }); |
| 56 | 56 | |
| 57 | - $distFiles = array_filter($globResult, function (string $file) { |
|
| 57 | + $distFiles = array_filter($globResult, function(string $file) { |
|
| 58 | 58 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
| 59 | 59 | |
| 60 | 60 | return $extension === 'dist'; |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | - $configFiles = array_filter($globResult, function (string $file) { |
|
| 63 | + $configFiles = array_filter($globResult, function(string $file) { |
|
| 64 | 64 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
| 65 | 65 | |
| 66 | 66 | return $extension !== 'override' && $extension !== 'dist'; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | $pathNodes = $this->extractNodes(self::NODE_PATH, $pshConfigNode); |
| 158 | 158 | |
| 159 | - return array_map(function (DOMElement $path) use ($file) { |
|
| 159 | + return array_map(function(DOMElement $path) use ($file) { |
|
| 160 | 160 | return $this->fixPath($this->applicationRootDirectory, $path->nodeValue, $file); |
| 161 | 161 | }, $pathNodes); |
| 162 | 162 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $templates = $this->extractNodes(self::NODE_TEMPLATE, $pshConfigNodes); |
| 172 | 172 | |
| 173 | - return array_map(function (DOMElement $template) use ($file) { |
|
| 173 | + return array_map(function(DOMElement $template) use ($file) { |
|
| 174 | 174 | return [ |
| 175 | 175 | 'source' => $this->fixPath( |
| 176 | 176 | $this->applicationRootDirectory, |
@@ -33,7 +33,6 @@ |
||
| 33 | 33 | * @param int $lineNumber |
| 34 | 34 | * @param bool $ignoreError |
| 35 | 35 | * @param bool $tty |
| 36 | - * @param bool $deferred |
|
| 37 | 36 | */ |
| 38 | 37 | public function __construct( |
| 39 | 38 | string $shellCommand, |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | private function runProcess(Process $process) |
| 186 | 186 | { |
| 187 | - $process->run(function ($type, $response) { |
|
| 187 | + $process->run(function($type, $response) { |
|
| 188 | 188 | $this->logger->log(new LogMessage($response, $type === Process::ERR)); |
| 189 | 189 | }); |
| 190 | 190 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | { |
| 263 | 263 | $deferredProcess = new DeferredProcess($parsedCommand, $command, $process); |
| 264 | 264 | |
| 265 | - $process->start(function ($type, $response) use ($deferredProcess) { |
|
| 265 | + $process->start(function($type, $response) use ($deferredProcess) { |
|
| 266 | 266 | $deferredProcess->log(new LogMessage($response, $type === Process::ERR)); |
| 267 | 267 | }); |
| 268 | 268 | |
@@ -259,7 +259,6 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | 261 | * @param Process $process |
| 262 | - * @param bool $ignoreError |
|
| 263 | 262 | * @return bool |
| 264 | 263 | */ |
| 265 | 264 | private function isProcessResultValid(Process $process, ProcessCommand $command): bool |
@@ -357,7 +356,7 @@ discard block |
||
| 357 | 356 | |
| 358 | 357 | /** |
| 359 | 358 | * @param DeferredProcess $deferredProcess |
| 360 | - * @param $index |
|
| 359 | + * @param integer $index |
|
| 361 | 360 | */ |
| 362 | 361 | private function logDeferredOutputStart(DeferredProcess $deferredProcess, $index) |
| 363 | 362 | { |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * @param string|null $environmentString |
|
| 106 | + * @param string|null $environment |
|
| 107 | 107 | * |
| 108 | 108 | * @return ScriptPath[] |
| 109 | 109 | */ |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | [$this->getEnvironment($environment), 'getDotenvPaths'] |
| 115 | 115 | ); |
| 116 | 116 | |
| 117 | - return array_map(function (string $path): ScriptPath { |
|
| 117 | + return array_map(function(string $path): ScriptPath { |
|
| 118 | 118 | return new ScriptPath($path, null); |
| 119 | 119 | }, $paths); |
| 120 | 120 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $paths = $this->extractData($key, $rawConfigData, []); |
| 153 | 153 | |
| 154 | - return array_map(function ($path) use ($file) { |
|
| 154 | + return array_map(function($path) use ($file) { |
|
| 155 | 155 | return $this->fixPath($this->applicationRootDirectory, $path, $file); |
| 156 | 156 | }, $paths); |
| 157 | 157 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $templates = $this->extractData(self::KEY_TEMPLATES, $rawConfigData, []); |
| 167 | 167 | |
| 168 | - return array_map(function ($template) use ($file) { |
|
| 168 | + return array_map(function($template) use ($file) { |
|
| 169 | 169 | $template['source'] = $this->fixPath($this->applicationRootDirectory, $template['source'], $file); |
| 170 | 170 | $template['destination'] = $this->makeAbsolutePath($file, $template['destination']); |
| 171 | 171 | |