From 2917968184cc21679a1fe1d33446d149a3fd21d3 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Wed, 3 Dec 2025 13:13:10 +0100 Subject: [PATCH 1/2] Declare typed parameters that are null by default as nullable Implicitly nullable parameters are deprecated in PHP 8.4 --- library/Cube/Cube.php | 4 ++-- library/Cube/Hook/IcingaDbActionsHook.php | 4 ++-- library/Cube/Ido/DataView/Hoststatus.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/Cube/Cube.php b/library/Cube/Cube.php index 1e688f0..0c14b10 100644 --- a/library/Cube/Cube.php +++ b/library/Cube/Cube.php @@ -327,10 +327,10 @@ public function listColumns() /** * @param View $view - * @param CubeRenderer $renderer + * @param ?CubeRenderer $renderer * @return string */ - public function render(View $view, CubeRenderer $renderer = null) + public function render(View $view, ?CubeRenderer $renderer = null) { if ($renderer === null) { $renderer = $this->getRenderer(); diff --git a/library/Cube/Hook/IcingaDbActionsHook.php b/library/Cube/Hook/IcingaDbActionsHook.php index 63c24fe..ce12575 100644 --- a/library/Cube/Hook/IcingaDbActionsHook.php +++ b/library/Cube/Hook/IcingaDbActionsHook.php @@ -71,10 +71,10 @@ final protected function addActionLink(Url $url, string $title, string $descript * Helper method instantiating an Url object * * @param string $path - * @param array $params + * @param ?array $params * @return Url */ - final protected function makeUrl(string $path, array $params = null): Url + final protected function makeUrl(string $path, ?array $params = null): Url { $url = Url::fromPath($path); if ($params !== null) { diff --git a/library/Cube/Ido/DataView/Hoststatus.php b/library/Cube/Ido/DataView/Hoststatus.php index 32ee44b..b639495 100644 --- a/library/Cube/Ido/DataView/Hoststatus.php +++ b/library/Cube/Ido/DataView/Hoststatus.php @@ -9,7 +9,7 @@ class Hoststatus extends \Icinga\Module\Monitoring\DataView\Hoststatus { - public function __construct(ConnectionInterface $connection, array $columns = null) + public function __construct(ConnectionInterface $connection, ?array $columns = null) { $this->connection = $connection; $this->query = new HoststatusQuery($connection->getResource(), $columns); From 8a3f3c1d31ff1184e25d97822a17579c022d0217 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Wed, 3 Dec 2025 13:58:24 +0100 Subject: [PATCH 2/2] Replace null as array key with an empty string Using null as an array key is deprecated in PHP-8.5, an empty string can be used for identical behavior --- application/forms/DimensionsForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/forms/DimensionsForm.php b/application/forms/DimensionsForm.php index fbfbbc7..731b696 100644 --- a/application/forms/DimensionsForm.php +++ b/application/forms/DimensionsForm.php @@ -79,7 +79,7 @@ public function assemble() $allDimensions = $this->cube->listAdditionalDimensions(); $this->addElement('select', 'addDimension', [ - 'options' => [null => $this->translate('+ Add a dimension')] + $allDimensions, + 'options' => ['' => $this->translate('+ Add a dimension')] + $allDimensions, 'class' => 'autosubmit' ]); }