@@ -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\Parser; |
6 | 6 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | private function hasDuplicatedValues(array $values): bool |
107 | 107 | { |
108 | - $duplicatedValues = array_filter(array_count_values($values), static function ($counter) { |
|
108 | + $duplicatedValues = array_filter(array_count_values($values), static function($counter) { |
|
109 | 109 | return $counter !== 1; |
110 | 110 | }); |
111 | 111 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | $errors = array_intersect($allEnvironments, array_keys($this->groups)); |
153 | 153 | |
154 | - if(! empty($errors)) |
|
154 | + if( ! empty($errors)) |
|
155 | 155 | { |
156 | 156 | throw new \RuntimeException(sprintf( |
157 | 157 | 'Error : a group can not be part of another group (%s)', |
@@ -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 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $this->variables = $variables; |
29 | 29 | |
30 | 30 | $this->externalReader = null; |
31 | - if(! empty($externalVariables)) |
|
31 | + if( ! empty($externalVariables)) |
|
32 | 32 | { |
33 | 33 | $this->externalReader = new Reader($externalVariables, [], $groups); |
34 | 34 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | if(in_array($environment, $this->groupNames, false)) |
63 | 63 | { |
64 | - if(! isset($this->defaultEnvironmentsForGroups[$environment])) |
|
64 | + if( ! isset($this->defaultEnvironmentsForGroups[$environment])) |
|
65 | 65 | { |
66 | 66 | throw new \RuntimeException(sprintf( |
67 | 67 | 'Group can not be used as environment (try with group %s detected)', |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | private function accessVariable(string $variableName) |
106 | 106 | { |
107 | - if(! array_key_exists($variableName, $this->variables)) |
|
107 | + if( ! array_key_exists($variableName, $this->variables)) |
|
108 | 108 | { |
109 | 109 | throw new \RuntimeException(sprintf( |
110 | 110 | 'Unknown variable %s', |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | private function processExternal(string $variable, string $environment) |
133 | 133 | { |
134 | - if(! $this->externalReader instanceof self) |
|
134 | + if( ! $this->externalReader instanceof self) |
|
135 | 135 | { |
136 | 136 | throw new \RuntimeException(sprintf( |
137 | 137 | 'There is no external variables. %s can not be resolve for environment %s', |
@@ -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\Display; |
6 | 6 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $lines = array(); |
73 | 73 | $lines[] = $separatorRow; |
74 | 74 | |
75 | - if(! empty($this->headers)) |
|
75 | + if( ! empty($this->headers)) |
|
76 | 76 | { |
77 | 77 | $lines[] = $this->renderLine($this->headers); |
78 | 78 | $lines[] = $separatorRow; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | return; |
96 | 96 | } |
97 | 97 | |
98 | - if(! empty($this->headers)) |
|
98 | + if( ! empty($this->headers)) |
|
99 | 99 | { |
100 | 100 | array_unshift($this->headers, ''); |
101 | 101 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $this->columnsSize = array_pad(array(), $this->nbColumns, -1); |
115 | 115 | |
116 | - if(! empty($this->headers)) |
|
116 | + if( ! empty($this->headers)) |
|
117 | 117 | { |
118 | 118 | $this->updateColumnsSize(array($this->headers)); |
119 | 119 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | foreach($newValues as $row) |
142 | 142 | { |
143 | - if(! is_array($row)) |
|
143 | + if( ! is_array($row)) |
|
144 | 144 | { |
145 | 145 | throw new \InvalidArgumentException('Rows must be arrays'); |
146 | 146 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | private function stripTags(string $value): string |
192 | 192 | { |
193 | - return preg_replace ('/<[^>]*>/', '', $value); |
|
193 | + return preg_replace('/<[^>]*>/', '', $value); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | private function renderLine(array $row): string |
@@ -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\Formatters; |
6 | 6 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | if($value === '<string>') |
53 | 53 | { |
54 | - $result = static function ($value) use ($result) { |
|
54 | + $result = static function($value) use ($result) { |
|
55 | 55 | return str_replace('<string>', $value, $result); |
56 | 56 | }; |
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\Filesystem\Adapters; |
6 | 6 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $this->cache = $cache; |
25 | 25 | $this->ttl = $ttl; |
26 | 26 | |
27 | - if(!$serializeCache) |
|
27 | + if( ! $serializeCache) |
|
28 | 28 | { |
29 | 29 | $serializeCache = new InMemory(); |
30 | 30 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | public function read($key) |
52 | 52 | { |
53 | - if ($this->needsReload($key)) |
|
53 | + if($this->needsReload($key)) |
|
54 | 54 | { |
55 | 55 | $contents = $this->source->read($key); |
56 | 56 | $this->cache->write($key, $contents); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | public function exists($key) |
91 | 91 | { |
92 | - if ($this->needsReload($key)) |
|
92 | + if($this->needsReload($key)) |
|
93 | 93 | { |
94 | 94 | return $this->source->exists($key); |
95 | 95 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | $cacheFile = 'keys.cache'; |
108 | 108 | |
109 | - if ($this->needsRebuild($cacheFile)) |
|
109 | + if($this->needsRebuild($cacheFile)) |
|
110 | 110 | { |
111 | 111 | $keys = $this->source->keys(); |
112 | 112 | sort($keys); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $needsReload = $dateCache < $dateSource; |
174 | 174 | } |
175 | 175 | } |
176 | - catch (\RuntimeException $e) |
|
176 | + catch(\RuntimeException $e) |
|
177 | 177 | { |
178 | 178 | } |
179 | 179 | } |
@@ -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", |
@@ -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 | } |