@@ -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 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * |
| 226 | 226 | * @return false|string |
| 227 | 227 | */ |
| 228 | - public static function iniSet(string $option, null|bool|float|int|string $value): false|string |
|
| 228 | + public static function iniSet(string $option, null | bool | float | int | string $value): false | string |
|
| 229 | 229 | { |
| 230 | 230 | self::$iniSetAvailable ??= \function_exists('ini_set'); |
| 231 | 231 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | * @param string $var Variable name. |
| 433 | 433 | * @param null|int|string $default Default value to substitute. |
| 434 | 434 | */ |
| 435 | - public static function var(string $var, null|int|string $default = ''): null|int|string |
|
| 435 | + public static function var(string $var, null | int | string $default = ''): null | int | string |
|
| 436 | 436 | { |
| 437 | 437 | /** @var null|int|string $value */ |
| 438 | 438 | $value = Arrays::get($_SERVER, $var) ?? $default; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @return false|string |
| 145 | 145 | */ |
| 146 | - public static function fileRead(string $file): false|string |
|
| 146 | + public static function fileRead(string $file): false | string |
|
| 147 | 147 | { |
| 148 | 148 | // Sanity check |
| 149 | 149 | if (!Filesystem::isFile($file)) { |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * |
| 169 | 169 | * @return false|int<0, max> |
| 170 | 170 | */ |
| 171 | - public static function fileWrite(string $file, string $data = '', int $flags = 0): false|int |
|
| 171 | + public static function fileWrite(string $file, string $data = '', int $flags = 0): false | int |
|
| 172 | 172 | { |
| 173 | 173 | // Sanity checks |
| 174 | 174 | if (!Filesystem::isFile($file)) { |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * |
| 349 | 349 | * @return array<string> |
| 350 | 350 | */ |
| 351 | - static function (array $tmp, string $item): array { |
|
| 351 | + static function(array $tmp, string $item): array { |
|
| 352 | 352 | if ($item === '..') { |
| 353 | 353 | array_pop($tmp); |
| 354 | 354 | } elseif ($item !== '.') { |
@@ -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 | /** |
| 55 | 55 | * @var null|bool $hasFinfo |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * |
| 233 | 233 | * @return false|string Returns the image type string on success, false on any failure. |
| 234 | 234 | */ |
| 235 | - private static function guessImageTypeExif(string $imagePath): false|string |
|
| 235 | + private static function guessImageTypeExif(string $imagePath): false | string |
|
| 236 | 236 | { |
| 237 | 237 | //@codeCoverageIgnoreStart |
| 238 | 238 | // Ignoring code coverage as if one method is available over another, the others won't be or need to be tested |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * |
| 252 | 252 | * @return false|string Returns the image type string on success, false on any failure. |
| 253 | 253 | */ |
| 254 | - private static function guessImageTypeFinfo(string $imagePath): false|string |
|
| 254 | + private static function guessImageTypeFinfo(string $imagePath): false | string |
|
| 255 | 255 | { |
| 256 | 256 | //@codeCoverageIgnoreStart |
| 257 | 257 | // Ignoring code coverage as if one method is available over another, the others won't be or need to be tested |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * |
| 283 | 283 | * @return false|string Returns the image type string on success, false on any failure. |
| 284 | 284 | */ |
| 285 | - private static function guessImageTypeGetImageSize(string $imagePath): false|string |
|
| 285 | + private static function guessImageTypeGetImageSize(string $imagePath): false | string |
|
| 286 | 286 | { |
| 287 | 287 | //@codeCoverageIgnoreStart |
| 288 | 288 | // Ignoring code coverage as if one method is available over another, the others won't be or need to be tested |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * |
| 72 | 72 | * @return TDefault|TValue |
| 73 | 73 | */ |
| 74 | - public static function get(array|ArrayAccess $array, int|string $key, mixed $default = null): mixed |
|
| 74 | + public static function get(array | ArrayAccess $array, int | string $key, mixed $default = null): mixed |
|
| 75 | 75 | { |
| 76 | 76 | if (self::keyExists($array, $key)) { |
| 77 | 77 | /** @var TValue */ |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | * |
| 155 | 155 | * @return array<int, TValue>|false |
| 156 | 156 | */ |
| 157 | - public static function interlace(array ...$arrays): array|false |
|
| 157 | + public static function interlace(array ...$arrays): array | false |
|
| 158 | 158 | { |
| 159 | 159 | if ($arrays === []) { |
| 160 | 160 | return false; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param array<TKey, TValue>|ArrayAccess<TKey, TValue> $array |
| 210 | 210 | * @param TKey $key |
| 211 | 211 | */ |
| 212 | - public static function keyExists(array|ArrayAccess $array, int|string $key): bool |
|
| 212 | + public static function keyExists(array | ArrayAccess $array, int | string $key): bool |
|
| 213 | 213 | { |
| 214 | 214 | if ($array instanceof ArrayAccess) { |
| 215 | 215 | return $array->offsetExists($key); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | public static function mapDeep(mixed $data, callable $callback, ?WeakMap $seen = null): mixed |
| 235 | 235 | { |
| 236 | 236 | /** @var WeakMap<object, true> $weakMap */ |
| 237 | - $weakMap = $seen ?? (static fn (): WeakMap => /** @return WeakMap<object, true> */ |
|
| 237 | + $weakMap = $seen ?? (static fn () : WeakMap => /** @return WeakMap<object, true> */ |
|
| 238 | 238 | new WeakMap())(); |
| 239 | 239 | |
| 240 | 240 | if (!\is_array($data) && !\is_object($data)) { |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | array_walk( |
| 261 | 261 | $props, |
| 262 | - static function (mixed $propValue, string $propName) use ($data, $callback, $weakMap): void { |
|
| 262 | + static function(mixed $propValue, string $propName) use ($data, $callback, $weakMap): void { |
|
| 263 | 263 | $data->$propName = self::mapDeep($propValue, $callback, $weakMap); |
| 264 | 264 | } |
| 265 | 265 | ); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | * |
| 285 | 285 | * @param-out (array<TKey, TValue>|ArrayAccess<TKey, TValue>) $array |
| 286 | 286 | */ |
| 287 | - public static function set(array|ArrayAccess &$array, null|int|string $key, mixed $value): void |
|
| 287 | + public static function set(array | ArrayAccess & $array, null | int | string $key, mixed $value): void |
|
| 288 | 288 | { |
| 289 | 289 | if ($key === null) { |
| 290 | 290 | $array[] = $value; |
@@ -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 | if (!\is_float($startingLatitude)) { |