diff options
author | Simon Rettberg | 2023-11-15 17:53:47 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-11-15 17:53:47 +0100 |
commit | aa49154e5a9ee135c3f0286ddda8a01a5290b1ed (patch) | |
tree | 0397403f11a8a890ee11458ea0b1887796480115 /modules-available/locations/inc | |
parent | idea: Always inspect as if strict_types is enabled (diff) | |
download | slx-admin-aa49154e5a9ee135c3f0286ddda8a01a5290b1ed.tar.gz slx-admin-aa49154e5a9ee135c3f0286ddda8a01a5290b1ed.tar.xz slx-admin-aa49154e5a9ee135c3f0286ddda8a01a5290b1ed.zip |
Fix more type errors, stricter typing
Diffstat (limited to 'modules-available/locations/inc')
-rw-r--r-- | modules-available/locations/inc/locationutil.inc.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/modules-available/locations/inc/locationutil.inc.php b/modules-available/locations/inc/locationutil.inc.php index 17608203..91117445 100644 --- a/modules-available/locations/inc/locationutil.inc.php +++ b/modules-available/locations/inc/locationutil.inc.php @@ -169,7 +169,7 @@ class LocationUtil return ($net1['startaddr'] <= $net2['endaddr'] && $net1['endaddr'] >= $net2['startaddr']); } - public static function rangeToLongVerbose(int $start, int $end): ?array + public static function rangeToLongVerbose(string $start, string $end): ?array { $result = self::rangeToLong($start, $end); list($startLong, $endLong) = $result; @@ -188,16 +188,11 @@ class LocationUtil return $result; } - public static function rangeToLong(int $start, int $end): array + /** @return array{0: int, 1: int} */ + public static function rangeToLong(string $start, string $end): array { $startLong = ip2long($start); $endLong = ip2long($end); - if ($startLong !== false) { - $startLong = sprintf("%u", $startLong); - } - if ($endLong !== false) { - $endLong = sprintf("%u", $endLong); - } return array($startLong, $endLong); } |