@@ -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 | |
@@ -265,12 +265,12 @@ discard block |
||
265 | 265 | $values = $this->readValueToInject($variable, $environment); |
266 | 266 | $formatter = $this->getFormatterForCurrentTargetFile(); |
267 | 267 | |
268 | - if(! is_array($values)) |
|
268 | + if( ! is_array($values)) |
|
269 | 269 | { |
270 | 270 | $values = [$values]; |
271 | 271 | } |
272 | 272 | |
273 | - array_walk($values, static function (& $value) use ($formatter) { |
|
273 | + array_walk($values, static function(& $value) use ($formatter) { |
|
274 | 274 | $value = $formatter->format($value); |
275 | 275 | }); |
276 | 276 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | { |
381 | 381 | $values = $this->readValueToInject($matches['variableName'], $environment); |
382 | 382 | |
383 | - if(!is_array($values)) |
|
383 | + if( ! is_array($values)) |
|
384 | 384 | { |
385 | 385 | throw new \RuntimeException(sprintf( |
386 | 386 | "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; |
6 | 6 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | foreach(array_keys($this->attributes) as $name) |
69 | 69 | { |
70 | - if(! isset($values[$name])) |
|
70 | + if( ! isset($values[$name])) |
|
71 | 71 | { |
72 | 72 | continue; |
73 | 73 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | return; |
199 | 199 | } |
200 | 200 | |
201 | - if(! $parameterValidators[$parameter]($value)) |
|
201 | + if( ! $parameterValidators[$parameter]($value)) |
|
202 | 202 | { |
203 | 203 | throw new \RuntimeException('Parameter %s format is invalid'); |
204 | 204 | } |
@@ -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 | } |