@@ -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, |
@@ -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 | } |
@@ -245,7 +245,7 @@ |
||
245 | 245 | |
246 | 246 | $scripts = $scriptFinder->getAllVisibleScripts(); |
247 | 247 | |
248 | - $commands = array_map(function (Script $script) { |
|
248 | + $commands = array_map(function(Script $script) { |
|
249 | 249 | return $script->getName(); |
250 | 250 | }, $scripts); |
251 | 251 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | public function getAllVisibleScripts(): array |
69 | 69 | { |
70 | - return array_filter($this->getAllScripts(), function (Script $script): bool { |
|
70 | + return array_filter($this->getAllScripts(), 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, function ($key) use ($query) { |
|
79 | + return array_filter($scripts, function($key) use ($query) { |
|
80 | 80 | return mb_strpos($key, $query) > -1 || levenshtein($key, $query) < 3; |
81 | 81 | }, ARRAY_FILTER_USE_KEY); |
82 | 82 | } |
@@ -62,19 +62,19 @@ |
||
62 | 62 | return $configFileCandidates; |
63 | 63 | } |
64 | 64 | |
65 | - $overrideFiles = array_filter($configFileCandidates, function (string $file) { |
|
65 | + $overrideFiles = array_filter($configFileCandidates, function(string $file) { |
|
66 | 66 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
67 | 67 | |
68 | 68 | return $extension === 'override'; |
69 | 69 | }); |
70 | 70 | |
71 | - $distFiles = array_filter($configFileCandidates, function (string $file) { |
|
71 | + $distFiles = array_filter($configFileCandidates, function(string $file) { |
|
72 | 72 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
73 | 73 | |
74 | 74 | return $extension === 'dist'; |
75 | 75 | }); |
76 | 76 | |
77 | - $configFiles = array_filter($configFileCandidates, function (string $file) { |
|
77 | + $configFiles = array_filter($configFileCandidates, function(string $file) { |
|
78 | 78 | $extension = pathinfo($file, PATHINFO_EXTENSION); |
79 | 79 | |
80 | 80 | return $extension !== 'override' && $extension !== 'dist'; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | private function runProcess(Process $process): void |
173 | 173 | { |
174 | - $process->run(function (string $type, string $response): void { |
|
174 | + $process->run(function(string $type, string $response): void { |
|
175 | 175 | $this->logger->log(new LogMessage($response, $type === Process::ERR)); |
176 | 176 | }); |
177 | 177 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | { |
232 | 232 | $deferredProcess = new DeferredProcess($parsedCommand, $command, $process); |
233 | 233 | |
234 | - $process->start(function (string $type, string $response) use ($deferredProcess): void { |
|
234 | + $process->start(function(string $type, string $response) use ($deferredProcess): void { |
|
235 | 235 | $deferredProcess->log(new LogMessage($response, $type === Process::ERR)); |
236 | 236 | }); |
237 | 237 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | private function mergeOverrideConfigEnvironments(Config $config, Config $override): array |
46 | 46 | { |
47 | - return $this->mapEnvironments($config, $override, function (ConfigEnvironment $environment, ConfigEnvironment $overrideEnvironment) { |
|
47 | + return $this->mapEnvironments($config, $override, function(ConfigEnvironment $environment, ConfigEnvironment $overrideEnvironment) { |
|
48 | 48 | return $this |
49 | 49 | ->mergeEnvironmentsAsOverride($environment, $overrideEnvironment); |
50 | 50 | }); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | private function mergeImportConfigEnvironments(Config $config, Config $import): array |
54 | 54 | { |
55 | - return $this->mapEnvironments($config, $import, function (ConfigEnvironment $environment, ConfigEnvironment $importEnvironment) { |
|
55 | + return $this->mapEnvironments($config, $import, function(ConfigEnvironment $environment, ConfigEnvironment $importEnvironment) { |
|
56 | 56 | return $this |
57 | 57 | ->mergeEnvironmentsAsImport($environment, $importEnvironment); |
58 | 58 | }); |
@@ -114,6 +114,9 @@ |
||
114 | 114 | return $this; |
115 | 115 | } |
116 | 116 | |
117 | + /** |
|
118 | + * @param string $description |
|
119 | + */ |
|
117 | 120 | public function addRequirePlaceholder(string $name, ?string $description = null): ConfigBuilder |
118 | 121 | { |
119 | 122 | $this->currentRequiredVariables[$name] = $description; |