@@ -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, |
@@ -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 | |
@@ -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 | |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | [$this->getEnvironment($environment), 'getDotenvPaths'] |
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | - return array_map(function (string $path): DotenvFile { |
|
| 116 | + return array_map(function(string $path): DotenvFile { |
|
| 117 | 117 | return new DotenvFile($path); |
| 118 | 118 | }, $paths); |
| 119 | 119 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | public function getAllVisibleScripts(): array |
| 70 | 70 | { |
| 71 | - return array_filter($this->getAllScripts(), function (Script $script): bool { |
|
| 71 | + return array_filter($this->getAllScripts(), function(Script $script): bool { |
|
| 72 | 72 | return !$script->isHidden(); |
| 73 | 73 | }); |
| 74 | 74 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | $scripts = $this->getAllVisibleScripts(); |
| 83 | 83 | |
| 84 | - return array_filter($scripts, function ($key) use ($query) { |
|
| 84 | + return array_filter($scripts, function($key) use ($query) { |
|
| 85 | 85 | return strpos($key, $query) > -1 || levenshtein($key, $query) < 3; |
| 86 | 86 | }, ARRAY_FILTER_USE_KEY); |
| 87 | 87 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | { |
| 212 | 212 | $countConfigFiles = count($configFiles); |
| 213 | 213 | for ($i = 0; $i < $countConfigFiles; $i++) { |
| 214 | - $configFiles[$i] = str_replace($this->rootDirectory."/", "", $configFiles[$i]); |
|
| 214 | + $configFiles[$i] = str_replace($this->rootDirectory . "/", "", $configFiles[$i]); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | if (count($configFiles) == 1) { |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | $scripts = $scriptFinder->getAllVisibleScripts(); |
| 249 | 249 | |
| 250 | - $commands = array_map(function (Script $script) { |
|
| 250 | + $commands = array_map(function(Script $script) { |
|
| 251 | 251 | return $script->getName(); |
| 252 | 252 | }, $scripts); |
| 253 | 253 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | private function createTokenHandler(ScriptLoader $loader): array |
| 79 | 79 | { |
| 80 | 80 | return [ |
| 81 | - self::TOKEN_ACTION => function (string $currentLine) use ($loader): string { |
|
| 81 | + self::TOKEN_ACTION => function(string $currentLine) use ($loader): string { |
|
| 82 | 82 | $scriptName = $this->removeFromStart(self::TOKEN_ACTION, $currentLine); |
| 83 | 83 | $actionScript = $this->scriptFinder->findScriptByName($scriptName); |
| 84 | 84 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | return ''; |
| 89 | 89 | }, |
| 90 | 90 | |
| 91 | - self::TOKEN_INCLUDE => function (string $currentLine, int $lineNumber, Script $script) use ($loader): string { |
|
| 91 | + self::TOKEN_INCLUDE => function(string $currentLine, int $lineNumber, Script $script) use ($loader): string { |
|
| 92 | 92 | $path = $this->findInclude($script, $this->removeFromStart(self::TOKEN_INCLUDE, $currentLine)); |
| 93 | 93 | $includeScript = new Script(pathinfo($path, PATHINFO_DIRNAME), pathinfo($path, PATHINFO_BASENAME), false); |
| 94 | 94 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | return ''; |
| 99 | 99 | }, |
| 100 | 100 | |
| 101 | - self::TOKEN_TEMPLATE => function (string $currentLine, int $lineNumber, Script $script): string { |
|
| 101 | + self::TOKEN_TEMPLATE => function(string $currentLine, int $lineNumber, Script $script): string { |
|
| 102 | 102 | $definition = $this->removeFromStart(self::TOKEN_TEMPLATE, $currentLine); |
| 103 | 103 | list($rawSource, $rawDestination) = explode(':', $definition); |
| 104 | 104 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | return ''; |
| 112 | 112 | }, |
| 113 | 113 | |
| 114 | - self::TOKEN_WAIT => function (string $currentLine, int $lineNumber): string { |
|
| 114 | + self::TOKEN_WAIT => function(string $currentLine, int $lineNumber): string { |
|
| 115 | 115 | $this->commandBuilder |
| 116 | 116 | ->addWaitCommand($lineNumber); |
| 117 | 117 | |
@@ -119,25 +119,25 @@ discard block |
||
| 119 | 119 | return ''; |
| 120 | 120 | }, |
| 121 | 121 | |
| 122 | - self::TOKEN_MODIFIER_IGNORE_ERROR => function (string $currentLine): string { |
|
| 122 | + self::TOKEN_MODIFIER_IGNORE_ERROR => function(string $currentLine): string { |
|
| 123 | 123 | $this->commandBuilder->setIgnoreError(); |
| 124 | 124 | |
| 125 | 125 | return $this->removeFromStart(self::TOKEN_MODIFIER_IGNORE_ERROR, $currentLine); |
| 126 | 126 | }, |
| 127 | 127 | |
| 128 | - self::TOKEN_MODIFIER_TTY => function (string $currentLine): string { |
|
| 128 | + self::TOKEN_MODIFIER_TTY => function(string $currentLine): string { |
|
| 129 | 129 | $this->commandBuilder->setTty(); |
| 130 | 130 | |
| 131 | 131 | return $this->removeFromStart(self::TOKEN_MODIFIER_TTY, $currentLine); |
| 132 | 132 | }, |
| 133 | 133 | |
| 134 | - self::TOKEN_MODIFIER_DEFERRED => function (string $currentLine): string { |
|
| 134 | + self::TOKEN_MODIFIER_DEFERRED => function(string $currentLine): string { |
|
| 135 | 135 | $this->commandBuilder->setDeferredExecution(); |
| 136 | 136 | |
| 137 | 137 | return $this->removeFromStart(self::TOKEN_MODIFIER_DEFERRED, $currentLine); |
| 138 | 138 | }, |
| 139 | 139 | |
| 140 | - self::TOKEN_WILDCARD => function (string $currentLine, int $lineNumber): string { |
|
| 140 | + self::TOKEN_WILDCARD => function(string $currentLine, int $lineNumber): string { |
|
| 141 | 141 | $this->commandBuilder |
| 142 | 142 | ->addProcessCommand($currentLine, $lineNumber); |
| 143 | 143 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | if ($this->startsWith(self::CONCATENATE_PREFIX, $line)) { |
| 223 | 223 | $lastValue = array_pop($lines); |
| 224 | - $lines[] = $lastValue . ' ' . trim($line); |
|
| 224 | + $lines[] = $lastValue . ' ' . trim($line); |
|
| 225 | 225 | |
| 226 | 226 | continue; |
| 227 | 227 | } |