@@ -48,6 +48,9 @@ |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param string $environment |
|
53 | + */ |
|
51 | 54 | public function getAllValuesForEnvironment(?string $environment = null): array |
52 | 55 | { |
53 | 56 | $result = []; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma\Configuration; |
6 | 6 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function setDefaultEnvironment(string $environment): void |
44 | 44 | { |
45 | - if(! empty($environment) && is_string($environment)) |
|
45 | + if( ! empty($environment) && is_string($environment)) |
|
46 | 46 | { |
47 | 47 | $this->defaultEnvironment = $environment; |
48 | 48 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | }, $value); |
92 | 92 | } |
93 | 93 | |
94 | - if(! is_string($value)) |
|
94 | + if( ! is_string($value)) |
|
95 | 95 | { |
96 | 96 | return $value; |
97 | 97 | } |
@@ -32,6 +32,11 @@ discard block |
||
32 | 32 | protected |
33 | 33 | $environment; |
34 | 34 | |
35 | + /** |
|
36 | + * @param string $name |
|
37 | + * @param string $description |
|
38 | + * @param string $outputTitle |
|
39 | + */ |
|
35 | 40 | public function __construct(Application $app, $name, $description, $outputTitle) |
36 | 41 | { |
37 | 42 | $this->name = $name; |
@@ -169,6 +174,9 @@ discard block |
||
169 | 174 | } |
170 | 175 | } |
171 | 176 | |
177 | + /** |
|
178 | + * @param string $optionName |
|
179 | + */ |
|
172 | 180 | private function parseOptionWithAssignments(InputInterface $input, $optionName) |
173 | 181 | { |
174 | 182 | $strings = $input->getOption($optionName); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | { |
147 | 147 | $processor->setSystemEnvironment($this->systemEnvironment); |
148 | 148 | |
149 | - $this->app['logger']->info(sprintf( |
|
149 | + $this->app['logger']->info(sprintf( |
|
150 | 150 | 'Hydrate <important>system</important> variables with <important>%s</important> values', |
151 | 151 | $this->systemEnvironment |
152 | 152 | )); |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | foreach($overrides as $variable => $value) |
198 | 198 | { |
199 | 199 | $logger->info(sprintf( |
200 | - 'Override <important>%s</important> with value <important>%s</important>', |
|
201 | - $variable, |
|
202 | - $value |
|
200 | + 'Override <important>%s</important> with value <important>%s</important>', |
|
201 | + $variable, |
|
202 | + $value |
|
203 | 203 | )); |
204 | 204 | |
205 | 205 | $value = $this->parseList($value); |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | foreach($data as $variable => $value) |
217 | 217 | { |
218 | 218 | $logger->info(sprintf( |
219 | - 'Set custom data <important>%s</important> with value <important>%s</important>', |
|
220 | - $variable, |
|
221 | - $value |
|
219 | + 'Set custom data <important>%s</important> with value <important>%s</important>', |
|
220 | + $variable, |
|
221 | + $value |
|
222 | 222 | )); |
223 | 223 | |
224 | 224 | $reader->setCustomData($variable, $this->filterValue($value)); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma\Console; |
6 | 6 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $sourcePath = $profile->getSourcePath(); |
108 | 108 | } |
109 | 109 | |
110 | - if(! is_array($sourcePath)) |
|
110 | + if( ! is_array($sourcePath)) |
|
111 | 111 | { |
112 | 112 | $sourcePath = [$sourcePath]; |
113 | 113 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | { |
174 | 174 | $strings = $input->getOption($optionName); |
175 | 175 | |
176 | - if(! is_array($strings)) |
|
176 | + if( ! is_array($strings)) |
|
177 | 177 | { |
178 | 178 | $strings = [$strings]; |
179 | 179 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma\Filters; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma; |
6 | 6 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $paths = $c['sources.path']; |
112 | 112 | |
113 | - if(! is_array($paths)) |
|
113 | + if( ! is_array($paths)) |
|
114 | 114 | { |
115 | 115 | $paths = [$paths]; |
116 | 116 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | $this['target.fileSystem.adapter'] = $this->factory(function(Container $c) { |
138 | 138 | |
139 | - if(! empty($c['target.path'])) |
|
139 | + if( ! empty($c['target.path'])) |
|
140 | 140 | { |
141 | 141 | $c['hydrator.allowNonDistFilesOverwrite'] = true; |
142 | 142 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | return new \Psr\Log\NullLogger(); |
210 | 210 | }); |
211 | 211 | |
212 | - $this['formatter.provider'] = function (Container $c) { |
|
212 | + $this['formatter.provider'] = function(Container $c) { |
|
213 | 213 | return new ProfileProvider($c['profile']); |
214 | 214 | }; |
215 | 215 | |
@@ -223,19 +223,19 @@ discard block |
||
223 | 223 | return $hydrator; |
224 | 224 | }); |
225 | 225 | |
226 | - $this['generator.nameTranslator'] = function (Container $c) { |
|
226 | + $this['generator.nameTranslator'] = function(Container $c) { |
|
227 | 227 | $translator = new FilePrefixTranslator(); |
228 | 228 | $translator->changeMasterFile($c['configuration.masterFile']); |
229 | 229 | |
230 | 230 | return $translator; |
231 | 231 | }; |
232 | 232 | |
233 | - $this['generator.variableProvider'] = $this->factory(function (Container $c) { |
|
233 | + $this['generator.variableProvider'] = $this->factory(function(Container $c) { |
|
234 | 234 | $provider = new VariableProvider($c['parser']); |
235 | 235 | |
236 | 236 | $profile = $c['profile']; |
237 | 237 | $options = $profile->getGeneratorOptions(); |
238 | - if(! isset($options['translator']) || $options['translator'] === 'prefix') |
|
238 | + if( ! isset($options['translator']) || $options['translator'] === 'prefix') |
|
239 | 239 | { |
240 | 240 | $provider->setNameTranslator($c['generator.nameTranslator']); |
241 | 241 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | return $provider; |
244 | 244 | }); |
245 | 245 | |
246 | - $this['configurationFilesGenerator'] = function (Container $c) { |
|
246 | + $this['configurationFilesGenerator'] = function(Container $c) { |
|
247 | 247 | return new YamlGenerator($c['generate.sources.fileSystem'], $c['configuration'], $c['generator.variableProvider']); |
248 | 248 | }; |
249 | 249 | } |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | private function writeLevel($level) |
51 | 51 | { |
52 | 52 | $message = str_pad(sprintf( |
53 | - '[%s]', |
|
54 | - strtoupper($level) |
|
53 | + '[%s]', |
|
54 | + strtoupper($level) |
|
55 | 55 | ), 10); |
56 | 56 | |
57 | 57 | $this->output->write($this->colorizeMessage($level, $message)); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if(isset($colors[$level])) |
68 | 68 | { |
69 | 69 | $message = sprintf( |
70 | - '<%1$s>%2$s</%1$s>', |
|
70 | + '<%1$s>%2$s</%1$s>', |
|
71 | 71 | 'fg=' . $colors[$level], |
72 | 72 | $message |
73 | 73 | ); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma\Logging; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma\Logging; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Karma\Logging; |
6 | 6 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | { |
45 | 45 | if($verbosity <= $this->output->getVerbosity()) |
46 | 46 | { |
47 | - if(! is_array($messages)) |
|
47 | + if( ! is_array($messages)) |
|
48 | 48 | { |
49 | 49 | $messages = array($messages); |
50 | 50 | } |
@@ -38,6 +38,10 @@ |
||
38 | 38 | return $this->write($messages, $newline, $type, OutputInterface::VERBOSITY_VERBOSE, 'white'); |
39 | 39 | } |
40 | 40 | |
41 | + /** |
|
42 | + * @param boolean $newline |
|
43 | + * @param string $textColor |
|
44 | + */ |
|
41 | 45 | private function write($messages, $newline, $type, $verbosity, $textColor) |
42 | 46 | { |
43 | 47 | if($this->output instanceof OutputInterface) |