@@ -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 | |
@@ -267,12 +267,12 @@ discard block |
||
| 267 | 267 | $values = $this->readValueToInject($variable, $environment); |
| 268 | 268 | $formatter = $this->formatterForCurrentTargetFile(); |
| 269 | 269 | |
| 270 | - if(! is_array($values)) |
|
| 270 | + if( ! is_array($values)) |
|
| 271 | 271 | { |
| 272 | 272 | $values = [$values]; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - array_walk($values, static function (& $value) use ($formatter) { |
|
| 275 | + array_walk($values, static function(& $value) use ($formatter) { |
|
| 276 | 276 | $value = $formatter->format($value); |
| 277 | 277 | }); |
| 278 | 278 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | { |
| 383 | 383 | $values = $this->readValueToInject($matches['variableName'], $environment); |
| 384 | 384 | |
| 385 | - if(!is_array($values)) |
|
| 385 | + if( ! is_array($values)) |
|
| 386 | 386 | { |
| 387 | 387 | throw new \RuntimeException(sprintf( |
| 388 | 388 | "Nested variable detected [%s] while writing %s at line %d", |
@@ -347,8 +347,7 @@ |
||
| 347 | 347 | { |
| 348 | 348 | $formatter = $this->formatterForCurrentTargetFile(); |
| 349 | 349 | |
| 350 | - $content = preg_replace_callback(self::VARIABLE_REGEX, function(array $matches) use($environment, $formatter) |
|
| 351 | - { |
|
| 350 | + $content = preg_replace_callback(self::VARIABLE_REGEX, function(array $matches) use($environment, $formatter) { |
|
| 352 | 351 | $value = $this->readValueToInject($matches['variableName'], $environment); |
| 353 | 352 | |
| 354 | 353 | if(is_array($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 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $sourcePath = $profile->sourcePath(); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if(! is_array($sourcePath)) |
|
| 114 | + if( ! is_array($sourcePath)) |
|
| 115 | 115 | { |
| 116 | 116 | $sourcePath = [$sourcePath]; |
| 117 | 117 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | { |
| 179 | 179 | $strings = $input->getOption($optionName); |
| 180 | 180 | |
| 181 | - if(! is_array($strings)) |
|
| 181 | + if( ! is_array($strings)) |
|
| 182 | 182 | { |
| 183 | 183 | $strings = [$strings]; |
| 184 | 184 | } |
@@ -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 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $unusedVariables = $processor->unusedVariables(); |
| 41 | 41 | |
| 42 | - if(! empty($unusedVariables)) |
|
| 42 | + if( ! empty($unusedVariables)) |
|
| 43 | 43 | { |
| 44 | 44 | $logger = $this->app['logger']; |
| 45 | 45 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $unvaluedVariables = $processor->unvaluedVariables(); |
| 58 | 58 | |
| 59 | - if(! empty($unvaluedVariables)) |
|
| 59 | + if( ! empty($unvaluedVariables)) |
|
| 60 | 60 | { |
| 61 | 61 | $logger = $this->app['logger']; |
| 62 | 62 | |
@@ -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 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $paths = $c['sources.path']; |
| 115 | 115 | |
| 116 | - if(! is_array($paths)) |
|
| 116 | + if( ! is_array($paths)) |
|
| 117 | 117 | { |
| 118 | 118 | $paths = [$paths]; |
| 119 | 119 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $this['target.fileSystem.adapter'] = $this->factory(function(Container $c) { |
| 141 | 141 | |
| 142 | - if(! empty($c['target.path'])) |
|
| 142 | + if( ! empty($c['target.path'])) |
|
| 143 | 143 | { |
| 144 | 144 | $c['hydrator.allowNonDistFilesOverwrite'] = true; |
| 145 | 145 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | return new NullLogger(); |
| 213 | 213 | }); |
| 214 | 214 | |
| 215 | - $this['formatter.provider'] = static function (Container $c) { |
|
| 215 | + $this['formatter.provider'] = static function(Container $c) { |
|
| 216 | 216 | return new ProfileProvider($c['profile']); |
| 217 | 217 | }; |
| 218 | 218 | |
@@ -226,19 +226,19 @@ discard block |
||
| 226 | 226 | return $hydrator; |
| 227 | 227 | }); |
| 228 | 228 | |
| 229 | - $this['generator.nameTranslator'] = static function (Container $c) { |
|
| 229 | + $this['generator.nameTranslator'] = static function(Container $c) { |
|
| 230 | 230 | $translator = new FilePrefixTranslator(); |
| 231 | 231 | $translator->changeMasterFile($c['configuration.masterFile']); |
| 232 | 232 | |
| 233 | 233 | return $translator; |
| 234 | 234 | }; |
| 235 | 235 | |
| 236 | - $this['generator.variableProvider'] = $this->factory(function (Container $c) { |
|
| 236 | + $this['generator.variableProvider'] = $this->factory(function(Container $c) { |
|
| 237 | 237 | $provider = new VariableProvider($c['parser']); |
| 238 | 238 | |
| 239 | 239 | $profile = $c['profile']; |
| 240 | 240 | $options = $profile->generatorOptions(); |
| 241 | - if(! isset($options['translator']) || $options['translator'] === 'prefix') |
|
| 241 | + if( ! isset($options['translator']) || $options['translator'] === 'prefix') |
|
| 242 | 242 | { |
| 243 | 243 | $provider->setNameTranslator($c['generator.nameTranslator']); |
| 244 | 244 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | return $provider; |
| 247 | 247 | }); |
| 248 | 248 | |
| 249 | - $this['configurationFilesGenerator'] = static function (Container $c) { |
|
| 249 | + $this['configurationFilesGenerator'] = static function(Container $c) { |
|
| 250 | 250 | return new YamlGenerator($c['generate.sources.fileSystem'], $c['configuration'], $c['generator.variableProvider']); |
| 251 | 251 | }; |
| 252 | 252 | } |
@@ -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)) |
|
| 45 | + if( ! empty($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 | } |
@@ -1,16 +1,16 @@ 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 | |
| 7 | 7 | trait FilterInputVariable |
| 8 | 8 | { |
| 9 | - private function filterValue(string|array|null $value): array|string|float|int|bool|null |
|
| 9 | + private function filterValue(string | array | null $value): array | string | float | int | bool | null |
|
| 10 | 10 | { |
| 11 | 11 | if(is_array($value)) |
| 12 | 12 | { |
| 13 | - return array_map(function ($item) { |
|
| 13 | + return array_map(function($item) { |
|
| 14 | 14 | return $this->filterOneValue($item); |
| 15 | 15 | }, $value); |
| 16 | 16 | } |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | return $this->filterOneValue($value); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - private function filterOneValue(?string $value): string|float|int|bool|null |
|
| 21 | + private function filterOneValue(?string $value): string | float | int | bool | null |
|
| 22 | 22 | { |
| 23 | - if(! is_string($value)) |
|
| 23 | + if( ! is_string($value)) |
|
| 24 | 24 | { |
| 25 | 25 | return $value; |
| 26 | 26 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return $value; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function parseList(string $value): string|array |
|
| 54 | + public function parseList(string $value): string | array |
|
| 55 | 55 | { |
| 56 | 56 | $value = trim($value); |
| 57 | 57 | |
@@ -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 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function allVariables(): array |
| 46 | 46 | { |
| 47 | - $variables = array_map(function($key){ |
|
| 47 | + $variables = array_map(function($key) { |
|
| 48 | 48 | return $this->extractVariableName($key); |
| 49 | 49 | }, array_keys($this->values)); |
| 50 | 50 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | public function allVariables(): array |
| 46 | 46 | { |
| 47 | - $variables = array_map(function($key){ |
|
| 47 | + $variables = array_map(function($key) { |
|
| 48 | 48 | return $this->extractVariableName($key); |
| 49 | 49 | }, array_keys($this->values)); |
| 50 | 50 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | return $this->values[$key]['value']; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - throw new \RuntimeException("Variable $variable does not exist"); |
|
| 42 | + throw new \RuntimeException("variable $variable does not exist"); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function allVariables(): array |