summaryrefslogtreecommitdiffstats
path: root/modules-available/locations
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-15 17:53:47 +0100
committerSimon Rettberg2023-11-15 17:53:47 +0100
commitaa49154e5a9ee135c3f0286ddda8a01a5290b1ed (patch)
tree0397403f11a8a890ee11458ea0b1887796480115 /modules-available/locations
parentidea: Always inspect as if strict_types is enabled (diff)
downloadslx-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')
-rw-r--r--modules-available/locations/inc/locationutil.inc.php11
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);
}