diff options
Diffstat (limited to 'modules-available/roomplanner/inc/composedroom.inc.php')
-rw-r--r-- | modules-available/roomplanner/inc/composedroom.inc.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/modules-available/roomplanner/inc/composedroom.inc.php b/modules-available/roomplanner/inc/composedroom.inc.php index cdd50984..3ee892db 100644 --- a/modules-available/roomplanner/inc/composedroom.inc.php +++ b/modules-available/roomplanner/inc/composedroom.inc.php @@ -98,7 +98,7 @@ class ComposedRoom extends Room return $this->orientation; } - public function subLocationIds() + public function subLocationIds(): array { return $this->list; } @@ -108,7 +108,7 @@ class ComposedRoom extends Room return $this->controlRoom; } - public function machineCount() + public function machineCount(): int { $sum = 0; foreach ($this->list as $lid) { @@ -117,10 +117,9 @@ class ComposedRoom extends Room return $sum; } - public function getSize(&$width, &$height) + public function getSize(?int &$width, ?int &$height) { $horz = ($this->orientation == 'horizontal'); - $width = $height = 0; foreach ($this->list as $locId) { self::$rooms[$locId]->getSize($w, $h); $width = $horz ? $width + $w : max($width, $w); @@ -128,7 +127,7 @@ class ComposedRoom extends Room } } - public function getIniClientSection(&$i, $offX = 0, $offY = 0) + public function getIniClientSection(int &$i, int $offX = 0, int $offY = 0) { if (!$this->enabled) return false; @@ -154,10 +153,10 @@ class ComposedRoom extends Room return $out; } - public function getShiftedArray($offX = 0, $offY = 0) + public function getShiftedArray(int $offX = 0, int $offY = 0): ?array { if (!$this->enabled) - return false; + return null; if ($this->orientation == 'horizontal') { $x = 1; $y = 0; @@ -168,7 +167,7 @@ class ComposedRoom extends Room $ret = []; foreach ($this->list as $locId) { $new = self::$rooms[$locId]->getShiftedArray($offX, $offY); - if ($new !== false) { + if ($new !== null) { $ret = array_merge($ret, $new); self::$rooms[$locId]->getSize($w, $h); $offX += $w * $x; @@ -176,7 +175,7 @@ class ComposedRoom extends Room } } if (empty($ret)) - return false; + return null; return $ret; } @@ -194,12 +193,12 @@ class ComposedRoom extends Room return false; } - public function isLeaf() + public function isLeaf(): bool { return false; } - public function shouldSkip() + public function shouldSkip(): bool { return !$this->enabled; } |