@@ -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 | } |
@@ -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]; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @return array<mixed>|false |
145 | 145 | */ |
146 | - public static function interlace(array ...$args): array|false |
|
146 | + public static function interlace(array ...$args): array | false |
|
147 | 147 | { |
148 | 148 | $numArgs = \count($args); |
149 | 149 | |
@@ -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); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * |
236 | 236 | * @throws RuntimeException If $array is not accessible |
237 | 237 | */ |
238 | - public static function set(array|ArrayAccess &$array, null|int|string $key, mixed $value): void |
|
238 | + public static function set(array | ArrayAccess & $array, null | int | string $key, mixed $value): void |
|
239 | 239 | { |
240 | 240 | if ($key === null) { |
241 | 241 | $array = $value; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | * @param array<mixed> $array Array to check |
251 | 251 | * @param int|string $value Value to check |
252 | 252 | */ |
253 | - public static function valueExists(array $array, int|string $value): bool |
|
253 | + public static function valueExists(array $array, int | string $value): bool |
|
254 | 254 | { |
255 | 255 | return \in_array($value, $array, true); |
256 | 256 | } |
@@ -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 !== '.') { |