@@ -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; |
@@ -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 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param float|int $min The minimum. |
70 | 70 | * @param float|int $max The maximum. |
71 | 71 | */ |
72 | - public static function inside(float|int $number, float|int $min, float|int $max): bool |
|
72 | + public static function inside(float | int $number, float | int $min, float | int $max): bool |
|
73 | 73 | { |
74 | 74 | return ($number >= $min && $number <= $max); |
75 | 75 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param float|int $min The minimum. |
106 | 106 | * @param float|int $max The maximum. |
107 | 107 | */ |
108 | - public static function outside(float|int $number, float|int $min, float|int $max): bool |
|
108 | + public static function outside(float | int $number, float | int $min, float | int $max): bool |
|
109 | 109 | { |
110 | 110 | return ($number < $min || $number > $max); |
111 | 111 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @return false|string |
140 | 140 | */ |
141 | - public static function fileRead(string $file): false|string |
|
141 | + public static function fileRead(string $file): false | string |
|
142 | 142 | { |
143 | 143 | // Sanity check |
144 | 144 | if (!Filesystem::isFile($file)) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @return false|int<0, max> |
165 | 165 | */ |
166 | - public static function fileWrite(string $file, string $data = '', int $flags = 0): false|int |
|
166 | + public static function fileWrite(string $file, string $data = '', int $flags = 0): false | int |
|
167 | 167 | { |
168 | 168 | // Sanity checks |
169 | 169 | if (!Filesystem::isFile($file)) { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | static fn (string $string, bool $binarySafe = false): bool => Strings::length($string, $binarySafe) > 0 |
337 | 337 | ); |
338 | 338 | |
339 | - $filtered = array_reduce($filtered, static function (array $tmp, string $item): array { |
|
339 | + $filtered = array_reduce($filtered, static function(array $tmp, string $item): array { |
|
340 | 340 | if ($item === '..') { |
341 | 341 | array_pop($tmp); |
342 | 342 | } elseif ($item !== '.') { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @uses ArrayAccess<TKey, TValue> |
88 | 88 | */ |
89 | - public static function get(array|ArrayAccess $array, int|string $key, mixed $default = null): mixed |
|
89 | + public static function get(array | ArrayAccess $array, int | string $key, mixed $default = null): mixed |
|
90 | 90 | { |
91 | 91 | if (Arrays::keyExists($array, $key)) { |
92 | 92 | return $array[$key]; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @template TKey |
166 | 166 | * @template TValue |
167 | 167 | */ |
168 | - public static function interlace(array ...$args): array|false |
|
168 | + public static function interlace(array ...$args): array | false |
|
169 | 169 | { |
170 | 170 | $numArgs = \count($args); |
171 | 171 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * |
217 | 217 | * @uses ArrayAccess<TKey, TValue> |
218 | 218 | */ |
219 | - public static function keyExists(array|ArrayAccess $array, int|string $key): bool |
|
219 | + public static function keyExists(array | ArrayAccess $array, int | string $key): bool |
|
220 | 220 | { |
221 | 221 | if ($array instanceof ArrayAccess) { |
222 | 222 | return $array->offsetExists($key); |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * |
290 | 290 | * @uses ArrayAccess<TKey, TValue> |
291 | 291 | */ |
292 | - public static function set(array|ArrayAccess &$array, null|int|string $key, mixed $value): void |
|
292 | + public static function set(array | ArrayAccess & $array, null | int | string $key, mixed $value): void |
|
293 | 293 | { |
294 | 294 | if ($key === null) { |
295 | 295 | $array = $value; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | * @template TKey of (int|string) |
312 | 312 | * @template TValue |
313 | 313 | */ |
314 | - public static function valueExists(array $array, int|string $value): bool |
|
314 | + public static function valueExists(array $array, int | string $value): bool |
|
315 | 315 | { |
316 | 316 | return \in_array($value, $array, true); |
317 | 317 | } |