From 0b98dc983c87ef2f86363419a839b6ad86d5d5be Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 4 Dec 2023 16:24:00 +0100 Subject: [locations] Fix wrong variable type error --- modules-available/locations/inc/location.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php index 59e6d2b6..807f8577 100644 --- a/modules-available/locations/inc/location.inc.php +++ b/modules-available/locations/inc/location.inc.php @@ -8,7 +8,7 @@ class Location private static $treeCache = false; private static $subnetMapCache = false; - public static function getTree() + public static function getTree(): array { if (self::$treeCache === false) { self::$treeCache = self::queryLocations(); @@ -166,15 +166,15 @@ class Location * Get nested array of all the locations and children of given locationid(s). * * @param int[]|int $idList List of location ids - * @param bool $locationTree used in recursive calls, don't pass + * @param ?array $locationTree used in recursive calls, don't pass * @return array list of passed locations plus their children */ - public static function getRecursive($idList, bool $locationTree = false): array + public static function getRecursive($idList, ?array $locationTree = null): array { if (!is_array($idList)) { $idList = array($idList); } - if ($locationTree === false) { + if ($locationTree === null) { $locationTree = self::getTree(); } $ret = array(); -- cgit v1.2.3-55-g7522