@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function isPossible(): bool |
17 | 17 | { |
18 | - if (str_starts_with($this->value, '*true')){ |
|
18 | + if (str_starts_with($this->value, '*true')) { |
|
19 | 19 | return true; |
20 | 20 | } |
21 | 21 | return strtolower($this->value) === 'true'; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function isPossible(): bool |
17 | 17 | { |
18 | - if (str_starts_with($this->value, '*false')){ |
|
18 | + if (str_starts_with($this->value, '*false')) { |
|
19 | 19 | return true; |
20 | 20 | } |
21 | 21 | return strtolower($this->value) === 'false'; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | public function isPossible(): bool |
16 | 16 | { |
17 | - if (str_starts_with($this->value, '*bool')){ |
|
17 | + if (str_starts_with($this->value, '*bool')) { |
|
18 | 18 | $this->value = preg_replace('/^(\*bool\s*)/', '', $this->value); |
19 | 19 | return true; |
20 | 20 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | public function loadEnv(bool $usePutEnv = false): void |
50 | 50 | { |
51 | - if ($usePutEnv){ |
|
51 | + if ($usePutEnv) { |
|
52 | 52 | $this->flags = $this->flags | self::POPULATE_PUTENV; |
53 | 53 | } |
54 | 54 | |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | - public function handleValue(string $key, ?string $value): float|bool|int|string|null |
|
91 | + public function handleValue(string $key, ?string $value): float | bool | int | string | null |
|
92 | 92 | { |
93 | 93 | |
94 | 94 | if ($value !== null) { |
95 | 95 | $quoted = 0; |
96 | - $value = preg_replace_callback('/^(?<quote>[\'"])?(?<value>.*)\1/', function ($matches) { |
|
96 | + $value = preg_replace_callback('/^(?<quote>[\'"])?(?<value>.*)\1/', function($matches) { |
|
97 | 97 | return match ($matches['quote']) { |
98 | 98 | "'" => $matches['value'], |
99 | 99 | "\"" => strtr($matches['value'], self::CHARACTER_MAP) |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | public function populate( |
116 | 116 | string $key, |
117 | - string|null $value, |
|
117 | + string | null $value, |
|
118 | 118 | ): void { |
119 | 119 | $value = $this->handleValue($key, $value); |
120 | 120 |
@@ -47,9 +47,9 @@ |
||
47 | 47 | |
48 | 48 | private function determine(): void |
49 | 49 | { |
50 | - foreach (self::DEFINABLE_TYPES_MAP as $typeClass) { |
|
51 | - /** @var TypeCastInterface $type */ |
|
52 | - $type = new $typeClass($this->originalValue); |
|
50 | + foreach (self::DEFINABLE_TYPES_MAP as $typeClass) { |
|
51 | + /** @var TypeCastInterface $type */ |
|
52 | + $type = new $typeClass($this->originalValue); |
|
53 | 53 | if ($type->isPossible()){ |
54 | 54 | $this->castedValue = $type->getCastedValue(); |
55 | 55 | break; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | Int16Type::class |
33 | 33 | ]; |
34 | 34 | |
35 | - private float|bool|int|string|null $castedValue; |
|
35 | + private float | bool | int | string | null $castedValue; |
|
36 | 36 | |
37 | 37 | public function __construct(private string $originalValue) |
38 | 38 | { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $this->determine(); |
41 | 41 | } |
42 | 42 | |
43 | - public static function castType(string|bool|int|float|null $value): string|bool|int|float|null |
|
43 | + public static function castType(string | bool | int | float | null $value): string | bool | int | float | null |
|
44 | 44 | { |
45 | 45 | if (gettype($value) !== 'string') { |
46 | 46 | return $value; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | return (new self($value))->getCastValue(); |
49 | 49 | } |
50 | 50 | |
51 | - public function getCastValue(): float|bool|int|string|null |
|
51 | + public function getCastValue(): float | bool | int | string | null |
|
52 | 52 | { |
53 | 53 | return $this->castedValue; |
54 | 54 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | foreach (self::DEFINABLE_TYPES_MAP as $typeClass) { |
59 | 59 | /** @var TypeCastInterface $type */ |
60 | 60 | $type = new $typeClass($this->originalValue); |
61 | - if ($type->isPossible()){ |
|
61 | + if ($type->isPossible()) { |
|
62 | 62 | $this->castedValue = $type->getCastedValue(); |
63 | 63 | break; |
64 | 64 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | { |
15 | 15 | } |
16 | 16 | |
17 | - public static function scalarValueToString(string|bool|int|float|null $value): string |
|
17 | + public static function scalarValueToString(string | bool | int | float | null $value): string |
|
18 | 18 | { |
19 | 19 | if (gettype($value) === 'boolean') { |
20 | 20 | return $value ? 'true' : 'false'; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | $result = preg_replace_callback( |
31 | 31 | '/(\${(?<variable>.+?)(?<default_value>:[-=?][^}]*)?})/', |
32 | - function (array $matches): string { |
|
32 | + function(array $matches): string { |
|
33 | 33 | $env = getenv($matches['variable']) ?: null; |
34 | 34 | |
35 | 35 | /** @var string|bool|int|float|null $val */ |