@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | ['name' => $name, 'value' => $value, 'index' => $index] = $this->resolveByStaticCall(); |
46 | 46 | } |
47 | 47 | |
48 | - if (is_null($name) || ! static::isValidName($name)) { |
|
48 | + if (is_null($name) || !static::isValidName($name)) { |
|
49 | 49 | throw new InvalidNameException($name, static::class); |
50 | 50 | } |
51 | 51 | |
52 | - if (is_null($value) || ! static::isValidValue($value)) { |
|
52 | + if (is_null($value) || !static::isValidValue($value)) { |
|
53 | 53 | throw new InvalidValueException($value, static::class); |
54 | 54 | } |
55 | 55 | |
56 | - if (is_null($index) || ! static::isValidIndex($index)) { |
|
56 | + if (is_null($index) || !static::isValidIndex($index)) { |
|
57 | 57 | throw new InvalidIndexException($index, static::class); |
58 | 58 | } |
59 | 59 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public static function __callStatic(string $name, array $arguments) |
85 | 85 | { |
86 | 86 | if (static::startsWith($name, 'is')) { |
87 | - if (! isset($arguments[0])) { |
|
87 | + if (!isset($arguments[0])) { |
|
88 | 88 | throw new ArgumentCountError('Calling '.static::class.'::'.$name.'() in static context requires one argument'); |
89 | 89 | } |
90 | 90 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public static function make($value): Enumerable |
177 | 177 | { |
178 | - if (! is_int($value) && ! is_string($value)) { |
|
178 | + if (!is_int($value) && !is_string($value)) { |
|
179 | 179 | throw new TypeError(static::class.'::make() expects string|int as argument but '.gettype($value).' given'); |
180 | 180 | } |
181 | 181 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $index = null; |
184 | 184 | |
185 | 185 | if (is_int($value)) { |
186 | - if (! static::isValidIndex($value)) { |
|
186 | + if (!static::isValidIndex($value)) { |
|
187 | 187 | throw new InvalidIndexException($value, static::class); |
188 | 188 | } |
189 | 189 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public static function getAll(): array |
211 | 211 | { |
212 | - return array_map(static function (int $index): Enumerable { |
|
212 | + return array_map(static function(int $index): Enumerable { |
|
213 | 213 | return static::make($index); |
214 | 214 | }, static::getIndices()); |
215 | 215 | } |
@@ -266,20 +266,20 @@ discard block |
||
266 | 266 | self::$cache[$class][$name]['index'] = static::make($name)->getIndex(); |
267 | 267 | } |
268 | 268 | |
269 | - $duplicatedValues = array_filter(array_count_values(static::getValues()), static function (int $count): bool { |
|
269 | + $duplicatedValues = array_filter(array_count_values(static::getValues()), static function(int $count): bool { |
|
270 | 270 | return $count > 1; |
271 | 271 | }); |
272 | 272 | |
273 | - if (! empty($duplicatedValues)) { |
|
273 | + if (!empty($duplicatedValues)) { |
|
274 | 274 | self::clearCache(); |
275 | 275 | throw new DuplicatedValueException(array_keys($duplicatedValues), static::class); |
276 | 276 | } |
277 | 277 | |
278 | - $duplicatedIndices = array_filter(array_count_values(static::getIndices()), static function (int $count): bool { |
|
278 | + $duplicatedIndices = array_filter(array_count_values(static::getIndices()), static function(int $count): bool { |
|
279 | 279 | return $count > 1; |
280 | 280 | }); |
281 | 281 | |
282 | - if (! empty($duplicatedIndices)) { |
|
282 | + if (!empty($duplicatedIndices)) { |
|
283 | 283 | self::clearCache(); |
284 | 284 | throw new DuplicatedIndexException(array_keys($duplicatedIndices), static::class); |
285 | 285 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | |
294 | 294 | $docComment = $reflection->getDocComment(); |
295 | 295 | |
296 | - if (! $docComment) { |
|
296 | + if (!$docComment) { |
|
297 | 297 | return $values; |
298 | 298 | } |
299 | 299 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | protected static function resolveFromStaticMethods(ReflectionClass $reflection): array |
310 | 310 | { |
311 | 311 | $selfReflection = new ReflectionClass(self::class); |
312 | - $selfMethods = array_map(static function (ReflectionMethod $method): string { |
|
312 | + $selfMethods = array_map(static function(ReflectionMethod $method): string { |
|
313 | 313 | return $method->getName(); |
314 | 314 | }, $selfReflection->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC)); |
315 | 315 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | foreach ($reflection->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC) as $method) { |
318 | 318 | if ( |
319 | 319 | $method->getDeclaringClass()->getName() === self::class |
320 | - || ! ($method->isPublic() && $method->isStatic()) |
|
320 | + || !($method->isPublic() && $method->isStatic()) |
|
321 | 321 | || in_array($method->getName(), $selfMethods) |
322 | 322 | ) { |
323 | 323 | continue; |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | $name = $backtrace[2]['function']; |
341 | 341 | |
342 | - if (! static::isValidName($name)) { |
|
342 | + if (!static::isValidName($name)) { |
|
343 | 343 | throw new InvalidValueException($name, static::class); |
344 | 344 | } |
345 | 345 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | protected static function getMappedIndex(string $name): ?int |
398 | 398 | { |
399 | - if (! defined(static::class.'::MAP_INDEX')) { |
|
399 | + if (!defined(static::class.'::MAP_INDEX')) { |
|
400 | 400 | return null; |
401 | 401 | } |
402 | 402 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | |
412 | 412 | protected static function getMappedValue(string $name): ?string |
413 | 413 | { |
414 | - if (! defined(static::class.'::MAP_VALUE')) { |
|
414 | + if (!defined(static::class.'::MAP_VALUE')) { |
|
415 | 415 | return null; |
416 | 416 | } |
417 | 417 |