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/exams | |
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/exams')
-rw-r--r-- | modules-available/exams/baseconfig/getconfig.inc.php | 4 | ||||
-rw-r--r-- | modules-available/exams/inc/exams.inc.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/modules-available/exams/baseconfig/getconfig.inc.php b/modules-available/exams/baseconfig/getconfig.inc.php index 748149ad..7e4a70df 100644 --- a/modules-available/exams/baseconfig/getconfig.inc.php +++ b/modules-available/exams/baseconfig/getconfig.inc.php @@ -18,10 +18,10 @@ if ($uuid !== null) { } if (Exams::isInExamMode($locationIds, $lectureId, $autoLogin)) { ConfigHolder::add('SLX_EXAM', 'yes', 10000); - if (strlen($lectureId) > 0) { + if (!empty($lectureId)) { ConfigHolder::add('SLX_EXAM_START', $lectureId, 10000); } - if (strlen($autoLogin) > 0) { + if (!empty($autoLogin)) { ConfigHolder::add('SLX_AUTOLOGIN', $autoLogin, 10000); } ConfigHolder::add('SLX_SYSTEMD_TARGET', 'exam-mode', 10000); diff --git a/modules-available/exams/inc/exams.inc.php b/modules-available/exams/inc/exams.inc.php index 86dc6d89..2a54c262 100644 --- a/modules-available/exams/inc/exams.inc.php +++ b/modules-available/exams/inc/exams.inc.php @@ -7,7 +7,7 @@ class Exams * @param int[] $locationIds of location ids. must be an associative array. * @return bool true iff for any of the given location ids an exam is scheduled. **/ - public static function isInExamMode(array $locationIds, &$lectureId = false, &$autoLogin = false): bool + public static function isInExamMode(array $locationIds, ?string &$lectureId = null, ?string &$autoLogin = null): bool { if (empty($locationIds)) { $locationIds[] = 0; |