From 9a5106c288519b008e0dfe5e85371701af32c0f3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 7 Jul 2025 13:37:19 +0200 Subject: [locations] Cleanup Location class There was a mess of functions which mostly, but not quite, did the same things. Get rid of a couple of them and fix call sites to use alternative ones that also fit the job. While at it, add phpdoc and comments to the remaining functions, trying to clarify what they were designed for. Lastly, the return type of functions that retrieve a location id has been changed from false|int to ?int (nullable types are just nicer). --- modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules-available/serversetup-bwlp-ipxe') diff --git a/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php index 759f4cad..fd9de9ed 100644 --- a/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/inc/ipxemenu.inc.php @@ -179,7 +179,7 @@ class IPxeMenu { $locationId = 0; if (Module::isAvailable('locations')) { - $locationId = Location::getFromIpAndUuid($ip, $uuid); + $locationId = Location::getFromIpAndUuid($ip, $uuid) ?? 0; } $menu = self::forLocation($locationId); if ($uuid !== null) { -- cgit v1.2.3-55-g7522