@@ -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,11 +88,11 @@ 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 | - $value = preg_replace_callback('/^(?<quote>[\'"])?(?<value>.*)\1/', function ($matches) { |
|
95 | + $value = preg_replace_callback('/^(?<quote>[\'"])?(?<value>.*)\1/', function($matches) { |
|
96 | 96 | return match ($matches['quote']) { |
97 | 97 | "'" => $matches['value'], |
98 | 98 | "\"" => strtr($matches['value'], self::CHARACTER_MAP) |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | public function populate( |
115 | 115 | string $key, |
116 | - string|null $value, |
|
116 | + string | null $value, |
|
117 | 117 | ): void { |
118 | 118 | $value = $this->handleValue($key, $value); |
119 | 119 |
@@ -14,12 +14,12 @@ |
||
14 | 14 | */ |
15 | 15 | private array $collection = []; |
16 | 16 | |
17 | - public function add(string $key, string|bool|int|float|null $value): void |
|
17 | + public function add(string $key, string | bool | int | float | null $value): void |
|
18 | 18 | { |
19 | 19 | $this->collection[$key] = $value; |
20 | 20 | } |
21 | 21 | |
22 | - public function get(string $key, float|bool|int|string|null $default = null): float|bool|int|string|null |
|
22 | + public function get(string $key, float | bool | int | string | null $default = null): float | bool | int | string | null |
|
23 | 23 | { |
24 | 24 | return $this->has($key) ? $this->collection[$key] : $default; |
25 | 25 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $envArray = []; |
28 | 28 | /** @var LineInterface $line */ |
29 | 29 | foreach ($this->parseLines($content) as $line) { |
30 | - if ($line instanceof EnvLine){ |
|
30 | + if ($line instanceof EnvLine) { |
|
31 | 31 | $envArray[$line->getKey()->getValue()] = $line->getValue()?->getValue(); |
32 | 32 | } |
33 | 33 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $structure = []; |
44 | 44 | /** @var LineInterface $line */ |
45 | 45 | foreach ($this->parseLines($content) as $line) { |
46 | - if ($line instanceof EnvLine){ |
|
46 | + if ($line instanceof EnvLine) { |
|
47 | 47 | $structure[$line->getKey()->getValue()] = $line; |
48 | 48 | continue; |
49 | 49 | } |
@@ -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 function getCastValue(): float|bool|int|string|null |
|
43 | + public function getCastValue(): float | bool | int | string | null |
|
44 | 44 | { |
45 | 45 | return $this->castedValue; |
46 | 46 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | foreach (self::DEFINABLE_TYPES_MAP as $typeClass) { |
51 | 51 | /** @var TypeCastInterface $type */ |
52 | 52 | $type = new $typeClass($this->originalValue); |
53 | - if ($type->isPossible()){ |
|
53 | + if ($type->isPossible()) { |
|
54 | 54 | $this->castedValue = $type->getCastedValue(); |
55 | 55 | break; |
56 | 56 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | $result = preg_replace_callback( |
23 | 23 | '/(\${(?<variable>.+?)(?<default_value>:[-=?][^}]*)?})/', |
24 | - function (array $matches): string { |
|
24 | + function(array $matches): string { |
|
25 | 25 | $env = getenv($matches['variable']) ?: null; |
26 | 26 | |
27 | 27 | /** @var string|bool|int|float|null $val */ |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | private array $paths = []; |
19 | 19 | |
20 | - public function getPath(): string|false |
|
20 | + public function getPath(): string | false |
|
21 | 21 | { |
22 | 22 | $key = key($this->paths); |
23 | 23 | if ($key === null) { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | interface StorageInterface |
6 | 6 | { |
7 | - public function getPath(): string|false; |
|
7 | + public function getPath(): string | false; |
|
8 | 8 | |
9 | 9 | public function isLoaded(string $path): bool; |
10 | 10 |
@@ -14,14 +14,14 @@ |
||
14 | 14 | |
15 | 15 | public function isPossible(): bool |
16 | 16 | { |
17 | - if (str_starts_with($this->value, '*int16')){ |
|
17 | + if (str_starts_with($this->value, '*int16')) { |
|
18 | 18 | $this->value = preg_replace('/^(\*int16\s*)/', '', $this->value); |
19 | 19 | return true; |
20 | 20 | } |
21 | 21 | return false; |
22 | 22 | } |
23 | 23 | |
24 | - public function getCastedValue(): int|float |
|
24 | + public function getCastedValue(): int | float |
|
25 | 25 | { |
26 | 26 | return hexdec($this->value); |
27 | 27 | } |
@@ -24,6 +24,6 @@ |
||
24 | 24 | |
25 | 25 | public function getCastedValue(): int |
26 | 26 | { |
27 | - return (int) $this->value; |
|
27 | + return (int)$this->value; |
|
28 | 28 | } |
29 | 29 | } |