@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | $paths = $this->extractData($key, $rawConfigData, []); |
| 132 | 132 | |
| 133 | - return array_map(function ($path) use ($file) { |
|
| 133 | + return array_map(function($path) use ($file) { |
|
| 134 | 134 | return $this->fixPath($this->applicationRootDirectory, $path, $file); |
| 135 | 135 | }, $paths); |
| 136 | 136 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $templates = $this->extractData(self::KEY_TEMPLATES, $rawConfigData, []); |
| 141 | 141 | |
| 142 | - return array_map(function ($template) use ($file) { |
|
| 142 | + return array_map(function($template) use ($file) { |
|
| 143 | 143 | $template['source'] = $this->fixPath($this->applicationRootDirectory, $template['source'], $file); |
| 144 | 144 | |
| 145 | 145 | return $template; |
@@ -61,19 +61,19 @@ |
||
| 61 | 61 | return $configFileCandidates; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $overrideFiles = array_filter($configFileCandidates, static function (string $file) { |
|
| 64 | + $overrideFiles = array_filter($configFileCandidates, static function(string $file) { |
|
| 65 | 65 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
| 66 | 66 | |
| 67 | 67 | return $extension === 'override'; |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | - $distFiles = array_filter($configFileCandidates, static function (string $file) { |
|
| 70 | + $distFiles = array_filter($configFileCandidates, static function(string $file) { |
|
| 71 | 71 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
| 72 | 72 | |
| 73 | 73 | return $extension === 'dist'; |
| 74 | 74 | }); |
| 75 | 75 | |
| 76 | - $configFiles = array_filter($configFileCandidates, static function (string $file) { |
|
| 76 | + $configFiles = array_filter($configFileCandidates, static function(string $file) { |
|
| 77 | 77 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
| 78 | 78 | |
| 79 | 79 | return $extension !== 'override' && $extension !== 'dist'; |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | [$this->getEnvironment($environment), 'getDotenvPaths'] |
| 144 | 144 | ); |
| 145 | 145 | |
| 146 | - return array_map(static function (string $path): DotenvFile { |
|
| 146 | + return array_map(static function(string $path): DotenvFile { |
|
| 147 | 147 | return new DotenvFile($path); |
| 148 | 148 | }, $paths); |
| 149 | 149 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | private function runProcess(Process $process): void |
| 166 | 166 | { |
| 167 | - $process->run(function (string $type, string $response): void { |
|
| 167 | + $process->run(function(string $type, string $response): void { |
|
| 168 | 168 | $this->logger->log(new LogMessage($response, $type === Process::ERR)); |
| 169 | 169 | }); |
| 170 | 170 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | { |
| 229 | 229 | $deferredProcess = new DeferredProcess($parsedCommand, $command, $process); |
| 230 | 230 | |
| 231 | - $process->start(static function (string $type, string $response) use ($deferredProcess): void { |
|
| 231 | + $process->start(static function(string $type, string $response) use ($deferredProcess): void { |
|
| 232 | 232 | $deferredProcess->log(new LogMessage($response, $type === Process::ERR)); |
| 233 | 233 | }); |
| 234 | 234 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | private function getPaddingSize(array $scripts): int |
| 151 | 151 | { |
| 152 | - return self::MIN_PADDING_SIZE + max(array_map(static function (Script $script) { |
|
| 152 | + return self::MIN_PADDING_SIZE + max(array_map(static function(Script $script) { |
|
| 153 | 153 | return mb_strlen($script->getName()); |
| 154 | 154 | }, $scripts)); |
| 155 | 155 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | $scripts = $scriptFinder->getAllVisibleScripts(); |
| 163 | 163 | |
| 164 | - $commands = array_map(static function (Script $script) { |
|
| 164 | + $commands = array_map(static function(Script $script) { |
|
| 165 | 165 | return $script->getName(); |
| 166 | 166 | }, $scripts); |
| 167 | 167 | |
@@ -75,29 +75,29 @@ discard block |
||
| 75 | 75 | private function createTokenHandler(ScriptLoader $loader): array |
| 76 | 76 | { |
| 77 | 77 | return [ |
| 78 | - self::TOKEN_ACTION => function (string $currentLine) use ($loader): string { |
|
| 78 | + self::TOKEN_ACTION => function(string $currentLine) use ($loader): string { |
|
| 79 | 79 | $scriptName = $this->removeFromStart(self::TOKEN_ACTION, $currentLine); |
| 80 | 80 | $actionScript = $this->scriptFinder->findScriptByName($scriptName); |
| 81 | 81 | |
| 82 | - $this->commandBuilder->scopeEmpty(static function () use ($loader, $actionScript) { |
|
| 82 | + $this->commandBuilder->scopeEmpty(static function() use ($loader, $actionScript) { |
|
| 83 | 83 | return $loader->loadScript($actionScript); |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | 86 | return ''; |
| 87 | 87 | }, |
| 88 | 88 | |
| 89 | - self::TOKEN_INCLUDE => function (string $currentLine, int $lineNumber, Script $script) use ($loader): string { |
|
| 89 | + self::TOKEN_INCLUDE => function(string $currentLine, int $lineNumber, Script $script) use ($loader): string { |
|
| 90 | 90 | $path = $this->findInclude($script, $this->removeFromStart(self::TOKEN_INCLUDE, $currentLine)); |
| 91 | 91 | $includeScript = new Script(pathinfo($path, PATHINFO_DIRNAME), pathinfo($path, PATHINFO_BASENAME), false, $script->getWorkingDirectory()); |
| 92 | 92 | |
| 93 | - $this->commandBuilder->scopeEmpty(static function () use ($loader, $includeScript) { |
|
| 93 | + $this->commandBuilder->scopeEmpty(static function() use ($loader, $includeScript) { |
|
| 94 | 94 | return $loader->loadScript($includeScript); |
| 95 | 95 | }); |
| 96 | 96 | |
| 97 | 97 | return ''; |
| 98 | 98 | }, |
| 99 | 99 | |
| 100 | - self::TOKEN_TEMPLATE => function (string $currentLine, int $lineNumber, Script $script): string { |
|
| 100 | + self::TOKEN_TEMPLATE => function(string $currentLine, int $lineNumber, Script $script): string { |
|
| 101 | 101 | $definition = $this->removeFromStart(self::TOKEN_TEMPLATE, $currentLine); |
| 102 | 102 | list($rawSource, $rawDestination) = explode(':', $definition); |
| 103 | 103 | |
@@ -109,32 +109,32 @@ discard block |
||
| 109 | 109 | return ''; |
| 110 | 110 | }, |
| 111 | 111 | |
| 112 | - self::TOKEN_WAIT => function (string $currentLine, int $lineNumber): string { |
|
| 112 | + self::TOKEN_WAIT => function(string $currentLine, int $lineNumber): string { |
|
| 113 | 113 | $this->commandBuilder |
| 114 | 114 | ->addWaitCommand($lineNumber); |
| 115 | 115 | |
| 116 | 116 | return ''; |
| 117 | 117 | }, |
| 118 | 118 | |
| 119 | - self::TOKEN_MODIFIER_IGNORE_ERROR => function (string $currentLine): string { |
|
| 119 | + self::TOKEN_MODIFIER_IGNORE_ERROR => function(string $currentLine): string { |
|
| 120 | 120 | $this->commandBuilder->setIgnoreError(); |
| 121 | 121 | |
| 122 | 122 | return $this->removeFromStart(self::TOKEN_MODIFIER_IGNORE_ERROR, $currentLine); |
| 123 | 123 | }, |
| 124 | 124 | |
| 125 | - self::TOKEN_MODIFIER_TTY => function (string $currentLine): string { |
|
| 125 | + self::TOKEN_MODIFIER_TTY => function(string $currentLine): string { |
|
| 126 | 126 | $this->commandBuilder->setTty(); |
| 127 | 127 | |
| 128 | 128 | return $this->removeFromStart(self::TOKEN_MODIFIER_TTY, $currentLine); |
| 129 | 129 | }, |
| 130 | 130 | |
| 131 | - self::TOKEN_MODIFIER_DEFERRED => function (string $currentLine): string { |
|
| 131 | + self::TOKEN_MODIFIER_DEFERRED => function(string $currentLine): string { |
|
| 132 | 132 | $this->commandBuilder->setDeferredExecution(); |
| 133 | 133 | |
| 134 | 134 | return $this->removeFromStart(self::TOKEN_MODIFIER_DEFERRED, $currentLine); |
| 135 | 135 | }, |
| 136 | 136 | |
| 137 | - self::TOKEN_WILDCARD => function (string $currentLine, int $lineNumber, Script $script): string { |
|
| 137 | + self::TOKEN_WILDCARD => function(string $currentLine, int $lineNumber, Script $script): string { |
|
| 138 | 138 | $this->commandBuilder |
| 139 | 139 | ->addProcessCommand($currentLine, $lineNumber, $script->getWorkingDirectory()); |
| 140 | 140 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function getAllVisibleScripts(): array |
| 69 | 69 | { |
| 70 | - return array_filter($this->getAllScripts(), static function (Script $script): bool { |
|
| 70 | + return array_filter($this->getAllScripts(), static function(Script $script): bool { |
|
| 71 | 71 | return !$script->isHidden(); |
| 72 | 72 | }); |
| 73 | 73 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $scripts = $this->getAllVisibleScripts(); |
| 78 | 78 | |
| 79 | - return array_filter($scripts, static function ($key) use ($query) { |
|
| 79 | + return array_filter($scripts, static function($key) use ($query) { |
|
| 80 | 80 | return mb_strpos($key, $query) !== false || levenshtein($key, $query) < 3; |
| 81 | 81 | }, ARRAY_FILTER_USE_KEY); |
| 82 | 82 | } |