From d6cb7d8b2b27f4102b6472c028159fb917e63886 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Mon, 1 Dec 2025 13:56:21 +0100 Subject: [PATCH 1/6] Declare typed parameters that default to null as nullable to ensure PHP 8.4 compatibility --- application/clicommands/MigrateCommand.php | 2 +- application/forms/RedisConfigForm.php | 8 +++---- .../Object/ProcessCheckResultCommand.php | 2 +- .../Command/Transport/ApiCommandTransport.php | 2 +- .../Command/Transport/CommandTransport.php | 2 +- .../Transport/CommandTransportInterface.php | 2 +- library/Icingadb/Common/HostStates.php | 4 ++-- library/Icingadb/Common/IcingaRedis.php | 6 ++--- library/Icingadb/Common/ServiceStates.php | 4 ++-- library/Icingadb/Common/StateBadges.php | 2 +- library/Icingadb/Compat/UrlMigrator.php | 4 ++-- library/Icingadb/Data/PivotTable.php | 24 +++++++++---------- .../Hook/Common/TotalSlaReportUtils.php | 2 +- library/Icingadb/Model/UnreachableParent.php | 2 +- .../ProvidedHook/Reporting/HostSlaReport.php | 2 +- .../Reporting/ServiceSlaReport.php | 2 +- .../ProvidedHook/Reporting/SlaReport.php | 8 +++---- library/Icingadb/ProvidedHook/X509/Sni.php | 2 +- library/Icingadb/Util/PerfDataSet.php | 4 ++-- library/Icingadb/Web/Controller.php | 6 ++--- .../Web/Navigation/Renderer/ProblemsBadge.php | 2 +- .../Icingadb/Widget/Detail/CustomVarTable.php | 2 +- library/Icingadb/Widget/ShowMore.php | 2 +- .../Icingadb/Common/StateBadgesTest.php | 2 +- 24 files changed, 49 insertions(+), 49 deletions(-) diff --git a/application/clicommands/MigrateCommand.php b/application/clicommands/MigrateCommand.php index 74b4ac4a9..ba79dee97 100644 --- a/application/clicommands/MigrateCommand.php +++ b/application/clicommands/MigrateCommand.php @@ -786,7 +786,7 @@ private function readFromIni($path, &$rc) return $config; } - private function createBackupIni(string $path, Config $config = null): void + private function createBackupIni(string $path, ?Config $config = null): void { $counter = 0; while (true) { diff --git a/application/forms/RedisConfigForm.php b/application/forms/RedisConfigForm.php index bed76b0c1..ccc7d04e1 100644 --- a/application/forms/RedisConfigForm.php +++ b/application/forms/RedisConfigForm.php @@ -675,13 +675,13 @@ public static function checkRedis(Form $form): bool * Wraps the given IPL validator class into a callback validator * for usage as the only validator of the element given by name. * - * @param string $cls IPL validator class FQN - * @param string $element Form element name - * @param Closure $additionalValidator + * @param string $cls IPL validator class FQN + * @param string $element Form element name + * @param ?Closure $additionalValidator * * @return array Callback validator */ - private function wrapIplValidator(string $cls, string $element, Closure $additionalValidator = null): array + private function wrapIplValidator(string $cls, string $element, ?Closure $additionalValidator = null): array { return [ 'Callback', diff --git a/library/Icingadb/Command/Object/ProcessCheckResultCommand.php b/library/Icingadb/Command/Object/ProcessCheckResultCommand.php index 24ae2f3ae..196071700 100644 --- a/library/Icingadb/Command/Object/ProcessCheckResultCommand.php +++ b/library/Icingadb/Command/Object/ProcessCheckResultCommand.php @@ -121,7 +121,7 @@ public function getOutput() * * @return $this */ - public function setPerformanceData(string $performanceData = null): self + public function setPerformanceData(?string $performanceData = null): self { $this->performanceData = $performanceData; diff --git a/library/Icingadb/Command/Transport/ApiCommandTransport.php b/library/Icingadb/Command/Transport/ApiCommandTransport.php index 1bfb50e67..3e85830d7 100644 --- a/library/Icingadb/Command/Transport/ApiCommandTransport.php +++ b/library/Icingadb/Command/Transport/ApiCommandTransport.php @@ -306,7 +306,7 @@ protected function sendCommand(IcingaApiCommand $command) * * @return mixed */ - public function send(IcingaCommand|IcingaApiCommand $command, int $now = null) + public function send(IcingaCommand|IcingaApiCommand $command, ?int $now = null) { if ($command instanceof IcingaCommand) { $command = $this->renderer->render($command); diff --git a/library/Icingadb/Command/Transport/CommandTransport.php b/library/Icingadb/Command/Transport/CommandTransport.php index 812279d7e..96313edeb 100644 --- a/library/Icingadb/Command/Transport/CommandTransport.php +++ b/library/Icingadb/Command/Transport/CommandTransport.php @@ -100,7 +100,7 @@ public static function createTransport(ConfigObject $config): ApiCommandTranspor * * @return mixed */ - public function send(IcingaCommand $command, int $now = null) + public function send(IcingaCommand $command, ?int $now = null) { $errors = []; $results = []; diff --git a/library/Icingadb/Command/Transport/CommandTransportInterface.php b/library/Icingadb/Command/Transport/CommandTransportInterface.php index ad07cb904..3e2786409 100644 --- a/library/Icingadb/Command/Transport/CommandTransportInterface.php +++ b/library/Icingadb/Command/Transport/CommandTransportInterface.php @@ -19,5 +19,5 @@ interface CommandTransportInterface * * @throws CommandTransportException If sending the Icinga command failed */ - public function send(IcingaCommand $command, int $now = null); + public function send(IcingaCommand $command, ?int $now = null); } diff --git a/library/Icingadb/Common/HostStates.php b/library/Icingadb/Common/HostStates.php index 06b923678..2e4582c23 100644 --- a/library/Icingadb/Common/HostStates.php +++ b/library/Icingadb/Common/HostStates.php @@ -52,7 +52,7 @@ public static function int(string $state): int * * @throws \InvalidArgumentException If the given host state is invalid, i.e. not known */ - public static function text(int $state = null): string + public static function text(?int $state = null): string { switch (true) { case $state === self::UP: @@ -83,7 +83,7 @@ public static function text(int $state = null): string * * @throws \InvalidArgumentException If the given host state is invalid, i.e. not known */ - public static function translated(int $state = null): string + public static function translated(?int $state = null): string { switch (true) { case $state === self::UP: diff --git a/library/Icingadb/Common/IcingaRedis.php b/library/Icingadb/Common/IcingaRedis.php index e6c58a78c..25bfbc1a4 100644 --- a/library/Icingadb/Common/IcingaRedis.php +++ b/library/Icingadb/Common/IcingaRedis.php @@ -176,7 +176,7 @@ protected function fetchState(string $key, array $ids, array $columns): Generato * * @return float|int|null */ - public static function getLastIcingaHeartbeat(Redis $redis = null) + public static function getLastIcingaHeartbeat(?Redis $redis = null) { if ($redis === null) { $redis = Backend::getRedis()->getConnection(); @@ -205,7 +205,7 @@ public static function getLastIcingaHeartbeat(Redis $redis = null) * * @return Redis */ - public static function getPrimaryRedis(Config $moduleConfig = null, Config $redisConfig = null): Redis + public static function getPrimaryRedis(?Config $moduleConfig = null, ?Config $redisConfig = null): Redis { if ($moduleConfig === null) { $moduleConfig = Config::module('icingadb'); @@ -239,7 +239,7 @@ public static function getPrimaryRedis(Config $moduleConfig = null, Config $redi * * @return ?Redis */ - public static function getSecondaryRedis(Config $moduleConfig = null, Config $redisConfig = null) + public static function getSecondaryRedis(?Config $moduleConfig = null, ?Config $redisConfig = null) { if ($moduleConfig === null) { $moduleConfig = Config::module('icingadb'); diff --git a/library/Icingadb/Common/ServiceStates.php b/library/Icingadb/Common/ServiceStates.php index 526f95ebe..185152c13 100644 --- a/library/Icingadb/Common/ServiceStates.php +++ b/library/Icingadb/Common/ServiceStates.php @@ -62,7 +62,7 @@ public static function int(string $state): int * * @throws \InvalidArgumentException If the given service state is invalid, i.e. not known */ - public static function text(int $state = null): string + public static function text(?int $state = null): string { switch (true) { case $state === self::OK: @@ -99,7 +99,7 @@ public static function text(int $state = null): string * * @throws \InvalidArgumentException If the given service state is invalid, i.e. not known */ - public static function translated(int $state = null): string + public static function translated(?int $state = null): string { switch (true) { case $state === self::OK: diff --git a/library/Icingadb/Common/StateBadges.php b/library/Icingadb/Common/StateBadges.php index 307248bd2..3f46f03bc 100644 --- a/library/Icingadb/Common/StateBadges.php +++ b/library/Icingadb/Common/StateBadges.php @@ -117,7 +117,7 @@ public function setUrl(Url $url): self * * @return Link */ - protected function createLink($content, Filter\Rule $filter = null): Link + protected function createLink($content, ?Filter\Rule $filter = null): Link { $url = clone $this->getUrl(); diff --git a/library/Icingadb/Compat/UrlMigrator.php b/library/Icingadb/Compat/UrlMigrator.php index 8cc64d59e..8753ff5bc 100644 --- a/library/Icingadb/Compat/UrlMigrator.php +++ b/library/Icingadb/Compat/UrlMigrator.php @@ -83,7 +83,7 @@ public static function transformUrl(Url $url): Url return $url; } - public static function transformParams(Url $url, string $transformerName = null): array + public static function transformParams(Url $url, ?string $transformerName = null): array { $transformer = new self(); @@ -156,7 +156,7 @@ public static function transformParams(Url $url, string $transformerName = null) * * @return Filter\Rule|false */ - public static function transformFilter(Filter\Rule $filter, string $queryTransformer = null) + public static function transformFilter(Filter\Rule $filter, ?string $queryTransformer = null) { $transformer = new self(); diff --git a/library/Icingadb/Data/PivotTable.php b/library/Icingadb/Data/PivotTable.php index 1aee20ccb..078959606 100644 --- a/library/Icingadb/Data/PivotTable.php +++ b/library/Icingadb/Data/PivotTable.php @@ -114,11 +114,11 @@ public function __construct(Query $query, string $xAxisColumn, string $yAxisColu /** * Set the filter to apply on the query for the x-axis * - * @param Filter\Rule $filter + * @param ?Filter\Rule $filter * * @return $this */ - public function setXAxisFilter(Filter\Rule $filter = null): self + public function setXAxisFilter(?Filter\Rule $filter = null): self { $this->xAxisFilter = $filter; return $this; @@ -127,11 +127,11 @@ public function setXAxisFilter(Filter\Rule $filter = null): self /** * Set the filter to apply on the query for the y-axis * - * @param Filter\Rule $filter + * @param ?Filter\Rule $filter * * @return $this */ - public function setYAxisFilter(Filter\Rule $filter = null): self + public function setYAxisFilter(?Filter\Rule $filter = null): self { $this->yAxisFilter = $filter; return $this; @@ -204,11 +204,11 @@ public function setYAxisHeader(string $yAxisHeader): self * * @param string $axis The axis for which to return the parameter ('x' or 'y') * @param string $param The parameter name to return - * @param int $default The default value to return + * @param ?int $default The default value to return * * @return int */ - protected function getPaginationParameter(string $axis, string $param, int $default = null): int + protected function getPaginationParameter(string $axis, string $param, ?int $default = null): int { /** @var Web $app */ $app = Icinga::app(); @@ -325,12 +325,12 @@ protected function queryYAxis(): Query * * $limit and $page are taken from the current request if not given. * - * @param int $limit The maximum amount of entries to fetch - * @param int $page The page to set as current one + * @param ?int $limit The maximum amount of entries to fetch + * @param ?int $page The page to set as current one * * @return Paginatable */ - public function paginateXAxis(int $limit = null, int $page = null): Paginatable + public function paginateXAxis(?int $limit = null, ?int $page = null): Paginatable { if ($limit === null || $page === null) { if ($limit === null) { @@ -357,12 +357,12 @@ public function paginateXAxis(int $limit = null, int $page = null): Paginatable * * $limit and $page are taken from the current request if not given. * - * @param int $limit The maximum amount of entries to fetch - * @param int $page The page to set as current one + * @param ?int $limit The maximum amount of entries to fetch + * @param ?int $page The page to set as current one * * @return Paginatable */ - public function paginateYAxis(int $limit = null, int $page = null): Paginatable + public function paginateYAxis(?int $limit = null, ?int $page = null): Paginatable { if ($limit === null || $page === null) { if ($limit === null) { diff --git a/library/Icingadb/Hook/Common/TotalSlaReportUtils.php b/library/Icingadb/Hook/Common/TotalSlaReportUtils.php index 1006056ae..f5d15a1af 100644 --- a/library/Icingadb/Hook/Common/TotalSlaReportUtils.php +++ b/library/Icingadb/Hook/Common/TotalSlaReportUtils.php @@ -13,7 +13,7 @@ trait TotalSlaReportUtils { - public function getHtml(Timerange $timerange, array $config = null) + public function getHtml(Timerange $timerange, ?array $config = null) { $data = $this->getData($timerange, $config); $count = $data->count(); diff --git a/library/Icingadb/Model/UnreachableParent.php b/library/Icingadb/Model/UnreachableParent.php index 7e3e208c3..aabcc338e 100644 --- a/library/Icingadb/Model/UnreachableParent.php +++ b/library/Icingadb/Model/UnreachableParent.php @@ -85,7 +85,7 @@ public function createBehaviors(Behaviors $behaviors): void ])); } - public static function on(Connection $db, Model $root = null): Query + public static function on(Connection $db, ?Model $root = null): Query { if ($root === null) { throw new InvalidArgumentException('Root node must not be null'); diff --git a/library/Icingadb/ProvidedHook/Reporting/HostSlaReport.php b/library/Icingadb/ProvidedHook/Reporting/HostSlaReport.php index d9c4f4f13..56f83c89d 100644 --- a/library/Icingadb/ProvidedHook/Reporting/HostSlaReport.php +++ b/library/Icingadb/ProvidedHook/Reporting/HostSlaReport.php @@ -44,7 +44,7 @@ protected function createReportRow($row) ->setValues([(float) $row->sla]); } - protected function fetchSla(Timerange $timerange, Rule $filter = null) + protected function fetchSla(Timerange $timerange, ?Rule $filter = null) { $sla = Host::on($this->getDb()) ->columns([ diff --git a/library/Icingadb/ProvidedHook/Reporting/ServiceSlaReport.php b/library/Icingadb/ProvidedHook/Reporting/ServiceSlaReport.php index 46a068437..efde4f4ae 100644 --- a/library/Icingadb/ProvidedHook/Reporting/ServiceSlaReport.php +++ b/library/Icingadb/ProvidedHook/Reporting/ServiceSlaReport.php @@ -44,7 +44,7 @@ protected function createReportRow($row) ->setValues([(float) $row->sla]); } - protected function fetchSla(Timerange $timerange, Rule $filter = null) + protected function fetchSla(Timerange $timerange, ?Rule $filter = null) { $sla = Service::on($this->getDb()) ->columns([ diff --git a/library/Icingadb/ProvidedHook/Reporting/SlaReport.php b/library/Icingadb/ProvidedHook/Reporting/SlaReport.php index 8dcc64e42..03256b396 100644 --- a/library/Icingadb/ProvidedHook/Reporting/SlaReport.php +++ b/library/Icingadb/ProvidedHook/Reporting/SlaReport.php @@ -59,9 +59,9 @@ abstract protected function createReportRow($row); * * @return iterable */ - abstract protected function fetchSla(Timerange $timerange, Rule $filter = null); + abstract protected function fetchSla(Timerange $timerange, ?Rule $filter = null); - protected function fetchReportData(Timerange $timerange, array $config = null) + protected function fetchReportData(Timerange $timerange, ?array $config = null) { $rd = $this->createReportData(); $rows = []; @@ -208,12 +208,12 @@ public function initConfigForm(Form $form) ]); } - public function getData(Timerange $timerange, array $config = null) + public function getData(Timerange $timerange, ?array $config = null) { return $this->fetchReportData($timerange, $config); } - public function getHtml(Timerange $timerange, array $config = null) + public function getHtml(Timerange $timerange, ?array $config = null) { $data = $this->getData($timerange, $config); diff --git a/library/Icingadb/ProvidedHook/X509/Sni.php b/library/Icingadb/ProvidedHook/X509/Sni.php index 6f20a7df6..ae34896cc 100644 --- a/library/Icingadb/ProvidedHook/X509/Sni.php +++ b/library/Icingadb/ProvidedHook/X509/Sni.php @@ -20,7 +20,7 @@ class Sni extends SniHook /** * @inheritDoc */ - public function getHosts(Filter $filter = null): Generator + public function getHosts(?Filter $filter = null): Generator { $this->getDb()->ping(); diff --git a/library/Icingadb/Util/PerfDataSet.php b/library/Icingadb/Util/PerfDataSet.php index df3139304..1def010fb 100644 --- a/library/Icingadb/Util/PerfDataSet.php +++ b/library/Icingadb/Util/PerfDataSet.php @@ -134,11 +134,11 @@ protected function readLabel(): string * Return all characters between the current parser position and the given character * * @param string $stopChar The character on which to stop - * @param string $backtrackOn The character on which to backtrack + * @param ?string $backtrackOn The character on which to backtrack * * @return string */ - protected function readUntil(string $stopChar, string $backtrackOn = null): string + protected function readUntil(string $stopChar, ?string $backtrackOn = null): string { $start = $this->parserPos; $breakCharEncounteredAt = null; diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php index ba59e0fba..90a76d6b3 100644 --- a/library/Icingadb/Web/Controller.php +++ b/library/Icingadb/Web/Controller.php @@ -317,11 +317,11 @@ protected function prepareSearchFilter(Query $query, string $search, Filter\Any /** * Require permission to access the given route * - * @param string $name If NULL, the current controller name is used + * @param ?string $name If NULL, the current controller name is used * * @throws SecurityException */ - public function assertRouteAccess(string $name = null) + public function assertRouteAccess(?string $name = null) { if (! $name) { $name = $this->getRequest()->getControllerName(); @@ -447,7 +447,7 @@ protected function addContent(ValidHtml $content) return parent::addContent($content); } - public function filter(Query $query, Filter\Rule $filter = null): self + public function filter(Query $query, ?Filter\Rule $filter = null): self { if ($this->format !== 'sql' || $this->hasPermission('config/authentication/roles/show')) { $this->applyRestrictions($query); diff --git a/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php b/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php index 5e0f55576..e3239ebf8 100644 --- a/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php +++ b/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php @@ -114,7 +114,7 @@ public function getTitle() return $this->title; } - public function render(NavigationItem $item = null): string + public function render(?NavigationItem $item = null): string { if ($item === null) { $item = $this->getItem(); diff --git a/library/Icingadb/Widget/Detail/CustomVarTable.php b/library/Icingadb/Widget/Detail/CustomVarTable.php index 0aac95c64..5c74a3c97 100644 --- a/library/Icingadb/Widget/Detail/CustomVarTable.php +++ b/library/Icingadb/Widget/Detail/CustomVarTable.php @@ -51,7 +51,7 @@ class CustomVarTable extends BaseHtmlElement * @param iterable $data * @param ?Model $object */ - public function __construct($data, Model $object = null) + public function __construct($data, ?Model $object = null) { $this->data = $data; $this->object = $object; diff --git a/library/Icingadb/Widget/ShowMore.php b/library/Icingadb/Widget/ShowMore.php index d7fc7fb4d..7de256259 100644 --- a/library/Icingadb/Widget/ShowMore.php +++ b/library/Icingadb/Widget/ShowMore.php @@ -27,7 +27,7 @@ class ShowMore extends BaseHtmlElement /** @var ?string */ protected $label; - public function __construct(ResultSet $resultSet, Url $url, string $label = null) + public function __construct(ResultSet $resultSet, Url $url, ?string $label = null) { $this->label = $label; $this->resultSet = $resultSet; diff --git a/test/php/library/Icingadb/Common/StateBadgesTest.php b/test/php/library/Icingadb/Common/StateBadgesTest.php index 0b9fd5e22..166edd384 100644 --- a/test/php/library/Icingadb/Common/StateBadgesTest.php +++ b/test/php/library/Icingadb/Common/StateBadgesTest.php @@ -83,7 +83,7 @@ protected function getStateInt(string $state): int return 0; } - public function generateLink($content, Filter\Rule $filter = null): Link + public function generateLink($content, ?Filter\Rule $filter = null): Link { return parent::createLink($content, $filter); } From 2dc8488bcc0553a6a9fd2abc925fb6e0c1f8a3be Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Mon, 1 Dec 2025 14:15:11 +0100 Subject: [PATCH 2/6] Remove call of Method ReflectionProperty::setAccessible, it had no effect since php 8.1 and is deprecated in php 8.5 --- library/Icingadb/Model/UnreachableParent.php | 1 - 1 file changed, 1 deletion(-) diff --git a/library/Icingadb/Model/UnreachableParent.php b/library/Icingadb/Model/UnreachableParent.php index aabcc338e..f7af77a6e 100644 --- a/library/Icingadb/Model/UnreachableParent.php +++ b/library/Icingadb/Model/UnreachableParent.php @@ -187,7 +187,6 @@ private static function selectNodes(Connection $db, Model $root): Select // TODO: ipl-orm doesn't preserve key order :'( $columnsProperty = (new \ReflectionClass($nodeSelect))->getProperty('columns'); - $columnsProperty->setAccessible(true); $columnsProperty->setValue($nodeSelect, array_merge( [ 'id' => null, From 3ba2ba0992e332b2324e9d8c7bc189ef13e22193 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Mon, 1 Dec 2025 14:20:10 +0100 Subject: [PATCH 3/6] Replace driver specific PDO constanst, which is deprectated in php 8.5 if the replacement is available for the current php version --- library/Icingadb/Common/Backend.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/library/Icingadb/Common/Backend.php b/library/Icingadb/Common/Backend.php index 908fea0dd..9b4cfc290 100644 --- a/library/Icingadb/Common/Backend.php +++ b/library/Icingadb/Common/Backend.php @@ -60,7 +60,16 @@ public static function getDb(): Connection $config->options = [PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ]; if ($config->db === 'mysql') { - $config->options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET SESSION SQL_MODE='STRICT_TRANS_TABLES" + // In PHP 8.5+, driver-specific constants of the PDO class are deprecated, + // but the replacements are only available since php 8.4 + if (version_compare(PHP_VERSION, '8.4.0', '<')) { + $mysqlAttrInitCommand = PDO::MYSQL_ATTR_INIT_COMMAND; + } else { + $mysqlAttrInitCommand = Pdo\Mysql::ATTR_INIT_COMMAND; + } + + $config->options[$mysqlAttrInitCommand] + = "SET SESSION SQL_MODE='STRICT_TRANS_TABLES" . ",NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'"; } From df87d2b9f965712746fcf4af03f2a65d6e25de48 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Mon, 1 Dec 2025 15:49:01 +0100 Subject: [PATCH 4/6] Add guard to not pass null as key to array_key_exists to ensure 8.5 compatibility --- library/Icingadb/Web/Control/ViewModeSwitcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icingadb/Web/Control/ViewModeSwitcher.php b/library/Icingadb/Web/Control/ViewModeSwitcher.php index 8068aeeff..04dfaf1a4 100644 --- a/library/Icingadb/Web/Control/ViewModeSwitcher.php +++ b/library/Icingadb/Web/Control/ViewModeSwitcher.php @@ -104,7 +104,7 @@ public function getViewMode(): string { $viewMode = $this->getPopulatedValue($this->getViewModeParam(), $this->getDefaultViewMode()); - if (array_key_exists($viewMode, static::$viewModes)) { + if ($viewMode && array_key_exists($viewMode, static::$viewModes)) { return $viewMode; } From 2cc880e3aa87fe0c476aa1b2d989da02f8761f7d Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Fri, 5 Dec 2025 14:36:38 +0100 Subject: [PATCH 5/6] Cleanup baseline --- phpstan-baseline-standard.neon | 420 --------------------------------- 1 file changed, 420 deletions(-) diff --git a/phpstan-baseline-standard.neon b/phpstan-baseline-standard.neon index ce60b3f7c..63061ee7c 100644 --- a/phpstan-baseline-standard.neon +++ b/phpstan-baseline-standard.neon @@ -48,96 +48,12 @@ parameters: count: 2 path: application/controllers/CommandTransportController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:acknowledgeAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:addCommentAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:assertIsGrantedOnCommandTargets\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:checkNowAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:fetchCommandTargets\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: application/controllers/CommentController.php - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:indexAction\(\) has no return type specified\.$#' identifier: missingType.return count: 1 path: application/controllers/CommentController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:processCheckresultAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:removeAcknowledgementAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:scheduleCheckAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:scheduleDowntimeAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:sendCustomNotificationAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:toggleFeaturesAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Parameter \#1 \$form of method Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:handleCommandForm\(\) expects Icinga\\Module\\Icingadb\\Forms\\Command\\CommandForm\|string, Icinga\\Module\\Icingadb\\Forms\\Command\\Object\\ToggleObjectFeaturesForm\|null given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/CommentController.php - - - - message: '#^Property Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:\$commandTargetModel \(ipl\\Orm\\Model\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: application/controllers/CommentController.php - - message: '#^Property Icinga\\Module\\Icingadb\\Controllers\\CommentController\:\:\$comment \(Icinga\\Module\\Icingadb\\Model\\Comment\) does not accept ipl\\Orm\\Model\.$#' identifier: assign.propertyType @@ -204,96 +120,12 @@ parameters: count: 1 path: application/controllers/ConfigController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:acknowledgeAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:addCommentAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:assertIsGrantedOnCommandTargets\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:checkNowAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:fetchCommandTargets\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: application/controllers/DowntimeController.php - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:indexAction\(\) has no return type specified\.$#' identifier: missingType.return count: 1 path: application/controllers/DowntimeController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:processCheckresultAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:removeAcknowledgementAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:scheduleCheckAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:scheduleDowntimeAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:sendCustomNotificationAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:toggleFeaturesAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Parameter \#1 \$form of method Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:handleCommandForm\(\) expects Icinga\\Module\\Icingadb\\Forms\\Command\\CommandForm\|string, Icinga\\Module\\Icingadb\\Forms\\Command\\Object\\ToggleObjectFeaturesForm\|null given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/DowntimeController.php - - - - message: '#^Property Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:\$commandTargetModel \(ipl\\Orm\\Model\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: application/controllers/DowntimeController.php - - message: '#^Property Icinga\\Module\\Icingadb\\Controllers\\DowntimeController\:\:\$downtime \(Icinga\\Module\\Icingadb\\Model\\Downtime\) does not accept ipl\\Orm\\Model\.$#' identifier: assign.propertyType @@ -468,12 +300,6 @@ parameters: count: 1 path: application/controllers/HostController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\HostController\:\:fetchCommandTargets\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: application/controllers/HostController.php - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\HostController\:\:processCheckresultAction\(\) has no return type specified\.$#' identifier: missingType.return @@ -546,12 +372,6 @@ parameters: count: 1 path: application/controllers/HostController.php - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/HostController.php - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:lessThanOrEqual\(\) expects float\|int\|string, mixed given\.$#' identifier: argument.type @@ -738,48 +558,6 @@ parameters: count: 1 path: application/controllers/HostsController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\MigrateController\:\:backendSupportAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/MigrateController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\MigrateController\:\:checkboxStateAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/MigrateController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\MigrateController\:\:checkboxSubmitAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/MigrateController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\MigrateController\:\:monitoringUrlAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/MigrateController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\MigrateController\:\:searchUrlAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/MigrateController.php - - - - message: '#^Parameter \#1 \$url of static method Icinga\\Web\\Url\:\:fromPath\(\) expects string, mixed given\.$#' - identifier: argument.type - count: 2 - path: application/controllers/MigrateController.php - - - - message: '#^Parameter \#2 \$subject of function preg_match expects string, string\|false given\.$#' - identifier: argument.type - count: 3 - path: application/controllers/MigrateController.php - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\NotificationsController\:\:completeAction\(\) has no return type specified\.$#' identifier: missingType.return @@ -858,12 +636,6 @@ parameters: count: 1 path: application/controllers/ServiceController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\ServiceController\:\:fetchCommandTargets\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: application/controllers/ServiceController.php - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\ServiceController\:\:processCheckresultAction\(\) has no return type specified\.$#' identifier: missingType.return @@ -948,12 +720,6 @@ parameters: count: 1 path: application/controllers/ServiceController.php - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 2 - path: application/controllers/ServiceController.php - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:lessThanOrEqual\(\) expects float\|int\|string, mixed given\.$#' identifier: argument.type @@ -1218,90 +984,6 @@ parameters: count: 1 path: application/controllers/TacticalController.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UserController\:\:indexAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UserController.php - - - - message: '#^Parameter \#1 \$title of method ipl\\Web\\Compat\\CompatController\:\:setTitle\(\) expects string, mixed given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/UserController.php - - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/UserController.php - - - - message: '#^Property Icinga\\Module\\Icingadb\\Controllers\\UserController\:\:\$user \(Icinga\\Module\\Icingadb\\Model\\User\) does not accept ipl\\Orm\\Model\.$#' - identifier: assign.propertyType - count: 1 - path: application/controllers/UserController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UsergroupController\:\:indexAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UsergroupController.php - - - - message: '#^Parameter \#1 \$title of method ipl\\Web\\Compat\\CompatController\:\:setTitle\(\) expects string, mixed given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/UsergroupController.php - - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 1 - path: application/controllers/UsergroupController.php - - - - message: '#^Property Icinga\\Module\\Icingadb\\Controllers\\UsergroupController\:\:\$usergroup \(Icinga\\Module\\Icingadb\\Model\\Usergroup\) does not accept ipl\\Orm\\Model\.$#' - identifier: assign.propertyType - count: 1 - path: application/controllers/UsergroupController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UsergroupsController\:\:completeAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UsergroupsController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UsergroupsController\:\:indexAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UsergroupsController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UsergroupsController\:\:searchEditorAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UsergroupsController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UsersController\:\:completeAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UsersController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UsersController\:\:indexAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UsersController.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Controllers\\UsersController\:\:searchEditorAction\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/controllers/UsersController.php - - message: '#^Method Icinga\\Module\\Icingadb\\Forms\\ApiTransportForm\:\:assemble\(\) has no return type specified\.$#' identifier: missingType.return @@ -1848,24 +1530,6 @@ parameters: count: 1 path: application/forms/RedisConfigForm.php - - - message: '#^Call to an undefined method ipl\\Html\\Contract\\FormElement\:\:isChecked\(\)\.$#' - identifier: method.notFound - count: 1 - path: application/forms/SetAsBackendForm.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Forms\\SetAsBackendForm\:\:assemble\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/forms/SetAsBackendForm.php - - - - message: '#^Method Icinga\\Module\\Icingadb\\Forms\\SetAsBackendForm\:\:onSuccess\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: application/forms/SetAsBackendForm.php - - message: '#^Call to an undefined method ipl\\Stdlib\\Filter\\Rule\:\:getColumn\(\)\.$#' identifier: method.notFound @@ -1998,12 +1662,6 @@ parameters: count: 1 path: library/Icingadb/Command/Object/GetObjectCommand.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Command\\Object\\ObjectsCommand\:\:getObjects\(\) return type has no value type specified in iterable type Traversable\.$#' - identifier: missingType.iterableValue - count: 1 - path: library/Icingadb/Command/Object/ObjectsCommand.php - - message: '#^Property Icinga\\Module\\Icingadb\\Command\\Object\\ProcessCheckResultCommand\:\:\$performanceData \(string\) does not accept string\|null\.$#' identifier: assign.propertyType @@ -2082,24 +1740,6 @@ parameters: count: 1 path: library/Icingadb/Command/Transport/CommandTransportInterface.php - - - message: '#^Cannot access offset ''in_downtime'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: library/Icingadb/Common/IcingaRedis.php - - - - message: '#^Cannot access offset ''is_acknowledged'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: library/Icingadb/Common/IcingaRedis.php - - - - message: '#^Cannot access offset ''state_type'' on mixed\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: library/Icingadb/Common/IcingaRedis.php - - message: '#^Method Icinga\\Module\\Icingadb\\Common\\IcingaRedis\:\:fetchHostState\(\) has parameter \$columns with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -2370,12 +2010,6 @@ parameters: count: 2 path: library/Icingadb/Compat/CompatHost.php - - - message: '#^Cannot call method columns\(\) on mixed\.$#' - identifier: method.nonObject - count: 1 - path: library/Icingadb/Compat/CompatHost.php - - message: '#^Cannot call method execute\(\) on mixed\.$#' identifier: method.nonObject @@ -2478,12 +2112,6 @@ parameters: count: 2 path: library/Icingadb/Compat/CompatHost.php - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 3 - path: library/Icingadb/Compat/CompatHost.php - - message: '#^Property Icinga\\Module\\Icingadb\\Compat\\CompatHost\:\:\$legacyColumns has no type specified\.$#' identifier: missingType.property @@ -2622,12 +2250,6 @@ parameters: count: 2 path: library/Icingadb/Compat/CompatService.php - - - message: '#^Cannot call method columns\(\) on mixed\.$#' - identifier: method.nonObject - count: 1 - path: library/Icingadb/Compat/CompatService.php - - message: '#^Cannot call method execute\(\) on mixed\.$#' identifier: method.nonObject @@ -2748,12 +2370,6 @@ parameters: count: 2 path: library/Icingadb/Compat/CompatService.php - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 3 - path: library/Icingadb/Compat/CompatService.php - - message: '#^Property Icinga\\Module\\Icingadb\\Compat\\CompatService\:\:\$legacyColumns has no type specified\.$#' identifier: missingType.property @@ -3270,12 +2886,6 @@ parameters: count: 2 path: library/Icingadb/Model/Behavior/Bitmask.php - - - message: '#^Cannot cast mixed to string\.$#' - identifier: cast.string - count: 1 - path: library/Icingadb/Model/Behavior/BoolCast.php - - message: '#^Call to an undefined method ipl\\Stdlib\\Filter\\Rule\:\:getColumn\(\)\.$#' identifier: method.notFound @@ -3348,12 +2958,6 @@ parameters: count: 1 path: library/Icingadb/Model/Behavior/FlattenedObjectVars.php - - - message: '#^Parameter \#2 \$value of static method ipl\\Stdlib\\Filter\:\:equal\(\) expects array\|bool\|float\|int\|string, mixed given\.$#' - identifier: argument.type - count: 1 - path: library/Icingadb/Model/Behavior/FlattenedObjectVars.php - - message: '#^Part \$column \(mixed\) of encapsed string cannot be cast to string\.$#' identifier: encapsedStringPart.nonString @@ -5724,12 +5328,6 @@ parameters: count: 1 path: library/Icingadb/Web/Control/SearchBar/ObjectSuggestions.php - - - message: '#^Cannot access property \$flatname on array\\.$#' - identifier: property.nonObject - count: 1 - path: library/Icingadb/Web/Control/SearchBar/ObjectSuggestions.php - - message: '#^Cannot call method getRoles\(\) on Icinga\\User\|null\.$#' identifier: method.nonObject @@ -6000,12 +5598,6 @@ parameters: count: 1 path: library/Icingadb/Web/Controller.php - - - message: '#^Method Icinga\\Module\\Icingadb\\Web\\Controller\:\:sendAsPdf\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: library/Icingadb/Web/Controller.php - - message: '#^PHPDoc tag @param references unknown parameter\: \$preserveParams$#' identifier: parameter.notFound @@ -6546,12 +6138,6 @@ parameters: count: 1 path: library/Icingadb/Widget/Detail/CustomVarTable.php - - - message: '#^Parameter \#2 \$value of method ipl\\Html\\Attributes\:\:add\(\) expects array\|bool\|string\|null, int given\.$#' - identifier: argument.type - count: 1 - path: library/Icingadb/Widget/Detail/CustomVarTable.php - - message: '#^Property Icinga\\Module\\Icingadb\\Widget\\Detail\\CustomVarTable\:\:\$data \(array\) does not accept iterable\.$#' identifier: assign.propertyType @@ -7296,12 +6882,6 @@ parameters: count: 2 path: library/Icingadb/Widget/Detail/ObjectDetail.php - - - message: '#^Possibly invalid array key type array\|bool\|string\|null\.$#' - identifier: offsetAccess.invalidOffset - count: 1 - path: library/Icingadb/Widget/Detail/ObjectDetail.php - - message: '#^Property Icinga\\Module\\Icingadb\\Widget\\Detail\\ObjectDetail\:\:\$compatObject has no type specified\.$#' identifier: missingType.property From f835d1437e3a612c953ea993e562c58c8b2499a5 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Thu, 11 Dec 2025 13:13:13 +0100 Subject: [PATCH 6/6] Prevent null being used as an array key --- library/Icingadb/Model/Behavior/Bitmask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icingadb/Model/Behavior/Bitmask.php b/library/Icingadb/Model/Behavior/Bitmask.php index f8d91f627..452c70061 100644 --- a/library/Icingadb/Model/Behavior/Bitmask.php +++ b/library/Icingadb/Model/Behavior/Bitmask.php @@ -56,7 +56,7 @@ public function toDb($value, $key, $context) public function rewriteCondition(Condition $condition, $relation = null) { $column = $condition->metaData()->get('columnName'); - if (! isset($this->properties[$column])) { + if (! isset($column) || ! isset($this->properties[$column])) { return; }