From 4782df4fee393443536665cba35072e7e41e65f2 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 30 May 2022 14:00:01 +0200 Subject: [PATCH 1/2] Form: Fix don't pass null values to strtolower() error --- library/Icinga/Web/Form.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 376c7e279..079ec7947 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -1221,7 +1221,8 @@ class Form extends Zend_Form */ public function isSubmitted() { - if (strtolower($this->getRequest()->getMethod()) !== $this->getMethod()) { + $requestMethod = $this->getRequest()->getMethod(); + if (strtolower($requestMethod ?: '') !== $this->getMethod()) { return false; } if ($this->getIsApiTarget() || $this->getRequest()->isApiRequest()) { @@ -1488,7 +1489,8 @@ class Form extends Zend_Form */ protected function getRequestData() { - if (strtolower($this->request->getMethod()) === $this->getMethod()) { + $requestMethod = $this->getRequest()->getMethod(); + if (strtolower($requestMethod ?: '') === $this->getMethod()) { return $this->request->{'get' . ($this->request->isPost() ? 'Post' : 'Query')}(); } From 8e6d4a6b46add743abc3664cf42b347ced0fd4cd Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 30 May 2022 14:01:30 +0200 Subject: [PATCH 2/2] LinearUnit: Make Iterator methods compatible with the parent methods --- library/Icinga/Chart/Unit/LinearUnit.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Chart/Unit/LinearUnit.php b/library/Icinga/Chart/Unit/LinearUnit.php index 7915b6aa3..ea4792b4e 100644 --- a/library/Icinga/Chart/Unit/LinearUnit.php +++ b/library/Icinga/Chart/Unit/LinearUnit.php @@ -124,6 +124,7 @@ class LinearUnit implements AxisUnit * * @return int */ + #[\ReturnTypeWillChange] public function current() { return $this->currentTick; @@ -132,7 +133,7 @@ class LinearUnit implements AxisUnit /** * Calculate the next tick and tick value */ - public function next() + public function next(): void { $this->currentTick += (100 / $this->nrOfTicks); $this->currentValue += (($this->max - $this->min) / $this->nrOfTicks); @@ -143,6 +144,7 @@ class LinearUnit implements AxisUnit * * @return string The label for the current tick */ + #[\ReturnTypeWillChange] public function key() { return (string) intval($this->currentValue); @@ -153,7 +155,7 @@ class LinearUnit implements AxisUnit * * @return bool */ - public function valid() + public function valid(): bool { return $this->currentTick >= 0 && $this->currentTick <= 100; } @@ -161,7 +163,7 @@ class LinearUnit implements AxisUnit /** * Reset the current tick and label value */ - public function rewind() + public function rewind(): void { $this->currentTick = 0; $this->currentValue = $this->min;