diff options
author | Simon Rettberg | 2023-11-14 14:47:55 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-11-14 14:47:55 +0100 |
commit | 06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch) | |
tree | 7e5493b102074672d8cfd8fe1a61e49f080edbe8 /modules-available/runmode/baseconfig/getconfig.inc.php | |
parent | Update phpstorm config (diff) | |
download | slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip |
Add function param/return types, fix a lot more phpstorm complaints
Diffstat (limited to 'modules-available/runmode/baseconfig/getconfig.inc.php')
-rw-r--r-- | modules-available/runmode/baseconfig/getconfig.inc.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules-available/runmode/baseconfig/getconfig.inc.php b/modules-available/runmode/baseconfig/getconfig.inc.php index 9c36cc75..a5de1053 100644 --- a/modules-available/runmode/baseconfig/getconfig.inc.php +++ b/modules-available/runmode/baseconfig/getconfig.inc.php @@ -1,20 +1,23 @@ <?php -(function($machineUuid) { +/** @var ?string $uuid */ +/** @var ?string $ip */ + +if ($uuid !== null) { $res = Database::queryFirst('SELECT module, modeid, modedata FROM runmode WHERE machineuuid = :uuid', - array('uuid' => $machineUuid)); + array('uuid' => $uuid)); if ($res === false) return; $config = RunMode::getModuleConfig($res['module']); - if ($config === false) + if ($config === null) return; if (!Module::isAvailable($res['module'])) return; // Not really possible because getModuleConfig would have failed but we should make sure if ($config->configHook !== false) { - call_user_func($config->configHook, $machineUuid, $res['modeid'], $res['modedata']); + call_user_func($config->configHook, $uuid, $res['modeid'], $res['modedata']); } if ($config->systemdDefaultTarget !== false) { ConfigHolder::add('SLX_SYSTEMD_TARGET', $config->systemdDefaultTarget, 10000); } ConfigHolder::add('SLX_RUNMODE_MODULE', $res['module']); -})($uuid); +} |