summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner
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/roomplanner
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/roomplanner')
-rw-r--r--modules-available/roomplanner/page.inc.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules-available/roomplanner/page.inc.php b/modules-available/roomplanner/page.inc.php
index 53e8bf0b..6708cd8a 100644
--- a/modules-available/roomplanner/page.inc.php
+++ b/modules-available/roomplanner/page.inc.php
@@ -4,14 +4,14 @@ class Page_Roomplanner extends Page
{
/**
- * @var int locationid of location we're editing
+ * @var ?int locationid of location we're editing, or null if unknown/not set
*/
- private $locationid = false;
+ private $locationid = null;
/**
* @var array location data from location table
*/
- private $location = false;
+ private $location = null;
/**
* @var string action to perform
@@ -25,8 +25,8 @@ class Page_Roomplanner extends Page
private function loadRequestedLocation()
{
- $this->locationid = Request::get('locationid', false, 'integer');
- if ($this->locationid !== false) {
+ $this->locationid = Request::get('locationid', null, 'integer');
+ if ($this->locationid !== null) {
$locs = Location::getLocationsAssoc();
if (isset($locs[$this->locationid])) {
$this->location = $locs[$this->locationid];
@@ -46,11 +46,11 @@ class Page_Roomplanner extends Page
$this->action = Request::any('action', 'show', 'string');
$this->loadRequestedLocation();
- if ($this->locationid === false) {
+ if ($this->locationid === null) {
Message::addError('need-locationid');
Util::redirect('?do=locations');
}
- if ($this->location === false) {
+ if ($this->location === null) {
Message::addError('locations.invalid-location-id', $this->locationid);
Util::redirect('?do=locations');
}
@@ -204,10 +204,10 @@ class Page_Roomplanner extends Page
} elseif ($this->action === 'save') {
// Save roomplan - give feedback if it failed so the window can stay open
$this->loadRequestedLocation();
- if ($this->locationid === false) {
+ if ($this->locationid === null) {
die('Missing locationid in save data');
}
- if ($this->location === false) {
+ if ($this->location === null) {
die('Location with id ' . $this->locationid . ' does not exist.');
}
$this->handleSaveRequest(true);