@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * |
222 | 222 | * @return false|string |
223 | 223 | */ |
224 | - public static function iniSet(string $option, null|bool|float|int|string $value): false|string |
|
224 | + public static function iniSet(string $option, null | bool | float | int | string $value): false | string |
|
225 | 225 | { |
226 | 226 | static $iniSetAvailable; |
227 | 227 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $ips = array_filter($ips, static fn (string $string): bool => Strings::length($string) > 0); |
285 | 285 | |
286 | 286 | // Traverses the $ips array. Set $ip to current value if it's a public IP. |
287 | - array_walk($ips, static function (string $value, int $key) use (&$ip): string { |
|
287 | + array_walk($ips, static function(string $value, int $key) use (&$ip): string { |
|
288 | 288 | if (Environment::isPublicIp($value)) { |
289 | 289 | $ip = $value; |
290 | 290 | } |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | * @param string $var Variable name. |
441 | 441 | * @param null|int|string $default Default value to substitute. |
442 | 442 | */ |
443 | - public static function var(string $var, null|int|string $default = ''): null|int|string |
|
443 | + public static function var(string $var, null | int | string $default = ''): null | int | string |
|
444 | 444 | { |
445 | 445 | /** @var null|int|string $value */ |
446 | 446 | $value = Arrays::get($_SERVER, $var) ?? $default; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @throws RuntimeException If $array is not accessible |
71 | 71 | */ |
72 | - public static function get(array | ArrayAccess $array, int|string $key, mixed $default = null): mixed |
|
72 | + public static function get(array | ArrayAccess $array, int | string $key, mixed $default = null): mixed |
|
73 | 73 | { |
74 | 74 | if (Arrays::keyExists($array, $key)) { |
75 | 75 | return $array[$key]; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param array<mixed>|ArrayAccess<mixed, mixed> $array Array to check |
188 | 188 | * @param int|string $key Key to check |
189 | 189 | */ |
190 | - public static function keyExists(array | ArrayAccess $array, int|string $key): bool |
|
190 | + public static function keyExists(array | ArrayAccess $array, int | string $key): bool |
|
191 | 191 | { |
192 | 192 | if ($array instanceof ArrayAccess) { |
193 | 193 | return $array->offsetExists($key); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | * |
237 | 237 | * @throws RuntimeException If $array is not accessible |
238 | 238 | */ |
239 | - public static function set(array | ArrayAccess &$array, null|int|string $key, mixed $value): void |
|
239 | + public static function set(array | ArrayAccess & $array, null | int | string $key, mixed $value): void |
|
240 | 240 | { |
241 | 241 | if ($key === null) { |
242 | 242 | $array = $value; // @phpstan-ignore-line |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @param array<mixed> $array Array to check |
252 | 252 | * @param int|string $value Value to check |
253 | 253 | */ |
254 | - public static function valueExists(array $array, int|string $value): bool |
|
254 | + public static function valueExists(array $array, int | string $value): bool |
|
255 | 255 | { |
256 | 256 | return \in_array($value, $array, true); |
257 | 257 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @return false|string |
141 | 141 | */ |
142 | - public static function fileRead(string $file): false|string |
|
142 | + public static function fileRead(string $file): false | string |
|
143 | 143 | { |
144 | 144 | // Sanity check |
145 | 145 | if (!Filesystem::isFile($file)) { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | static fn (string $string, bool $binarySafe = false): bool => Strings::length($string, $binarySafe) > 0 |
338 | 338 | ); |
339 | 339 | |
340 | - $filtered = array_reduce($filtered, static function (array $tmp, string $item): array { |
|
340 | + $filtered = array_reduce($filtered, static function(array $tmp, string $item): array { |
|
341 | 341 | if ($item === '..') { |
342 | 342 | array_pop($tmp); |
343 | 343 | } elseif ($item !== '.') { |
@@ -159,10 +159,10 @@ |
||
159 | 159 | * @return array<string, float|int|string> |
160 | 160 | */ |
161 | 161 | public static function haversineDistance( |
162 | - float|int $startingLatitude, |
|
163 | - float|int $startingLongitude, |
|
164 | - float|int $endingLatitude, |
|
165 | - float|int $endingLongitude, |
|
162 | + float | int $startingLatitude, |
|
163 | + float | int $startingLongitude, |
|
164 | + float | int $endingLatitude, |
|
165 | + float | int $endingLongitude, |
|
166 | 166 | int $precision = 0 |
167 | 167 | ): array { |
168 | 168 | // Radians |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return false|string Returns the image type string on success, false on any failure. |
51 | 51 | */ |
52 | - public static function guessImageType(string $imagePath): false|string |
|
52 | + public static function guessImageType(string $imagePath): false | string |
|
53 | 53 | { |
54 | 54 | static $hasFinfo; |
55 | 55 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * |
218 | 218 | * @return false|string Returns the image type string on success, false on any failure. |
219 | 219 | */ |
220 | - private static function guessImageTypeExif(string $imagePath): false|string |
|
220 | + private static function guessImageTypeExif(string $imagePath): false | string |
|
221 | 221 | { |
222 | 222 | //@codeCoverageIgnoreStart |
223 | 223 | // Ignoring code coverage as if one method is available over another, the others won't be or need to be tested |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | * |
237 | 237 | * @return false|string Returns the image type string on success, false on any failure. |
238 | 238 | */ |
239 | - private static function guessImageTypeFinfo(string $imagePath): false|string |
|
239 | + private static function guessImageTypeFinfo(string $imagePath): false | string |
|
240 | 240 | { |
241 | 241 | //@codeCoverageIgnoreStart |
242 | 242 | // Ignoring code coverage as if one method is available over another, the others won't be or need to be tested |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * |
268 | 268 | * @return false|string Returns the image type string on success, false on any failure. |
269 | 269 | */ |
270 | - private static function guessImageTypeGetImageSize(string $imagePath): false|string |
|
270 | + private static function guessImageTypeGetImageSize(string $imagePath): false | string |
|
271 | 271 | { |
272 | 272 | //@codeCoverageIgnoreStart |
273 | 273 | // Ignoring code coverage as if one method is available over another, the others won't be or need to be tested |