diff --git a/library/Icingadb/Widget/ItemList/HostDetailHeader.php b/library/Icingadb/Widget/ItemList/HostDetailHeader.php index 97176dac9..b7afb2327 100644 --- a/library/Icingadb/Widget/ItemList/HostDetailHeader.php +++ b/library/Icingadb/Widget/ItemList/HostDetailHeader.php @@ -50,7 +50,9 @@ protected function assembleVisual(BaseHtmlElement $visual): void } $stateChange->setIcon($this->state->getIcon()); - $stateChange->setHandled($this->state->is_handled || ! $this->state->is_reachable); + $stateChange->setHandled( + $this->state->is_problem && ($this->state->is_handled || ! $this->state->is_reachable) + ); $visual->addHtml($stateChange); } diff --git a/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php b/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php index 2f0dbbd8c..8c5094d73 100644 --- a/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php +++ b/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php @@ -50,7 +50,9 @@ protected function assembleVisual(BaseHtmlElement $visual): void } $stateChange->setIcon($this->state->getIcon()); - $stateChange->setHandled($this->state->is_handled || ! $this->state->is_reachable); + $stateChange->setHandled( + $this->state->is_problem && ($this->state->is_handled || ! $this->state->is_reachable) + ); $visual->addHtml($stateChange); } diff --git a/library/Icingadb/Widget/ItemList/StateListItem.php b/library/Icingadb/Widget/ItemList/StateListItem.php index d0b336341..cd8ff163e 100644 --- a/library/Icingadb/Widget/ItemList/StateListItem.php +++ b/library/Icingadb/Widget/ItemList/StateListItem.php @@ -99,7 +99,7 @@ protected function assembleVisual(BaseHtmlElement $visual): void { $stateBall = new StateBall($this->state->getStateText(), $this->getStateBallSize()); $stateBall->add($this->state->getIcon()); - if ($this->state->is_handled || ! $this->state->is_reachable) { + if ($this->state->is_problem && ($this->state->is_handled || ! $this->state->is_reachable)) { $stateBall->getAttributes()->add('class', 'handled'); } diff --git a/library/Icingadb/Widget/ItemTable/StateRowItem.php b/library/Icingadb/Widget/ItemTable/StateRowItem.php index f62286b74..7ca93921c 100644 --- a/library/Icingadb/Widget/ItemTable/StateRowItem.php +++ b/library/Icingadb/Widget/ItemTable/StateRowItem.php @@ -33,7 +33,7 @@ protected function assembleVisual(BaseHtmlElement $visual) $stateBall = new StateBall($this->item->state->getStateText(), StateBall::SIZE_LARGE); $stateBall->add($this->item->state->getIcon()); - if ($this->item->state->is_handled) { + if ($this->item->state->is_problem && ($this->item->state->is_handled || ! $this->item->state->is_reachable)) { $stateBall->getAttributes()->add('class', 'handled'); } diff --git a/phpstan-baseline-standard.neon b/phpstan-baseline-standard.neon index a2b761a0d..644347155 100644 --- a/phpstan-baseline-standard.neon +++ b/phpstan-baseline-standard.neon @@ -7635,6 +7635,16 @@ parameters: count: 1 path: library/Icingadb/Widget/ItemTable/StateRowItem.php + - + message: "#^Cannot access property \\$is_problem on mixed\\.$#" + count: 1 + path: library/Icingadb/Widget/ItemTable/StateRowItem.php + + - + message: "#^Cannot access property \\$is_reachable on mixed\\.$#" + count: 1 + path: library/Icingadb/Widget/ItemTable/StateRowItem.php + - message: "#^Cannot access property \\$last_state_change on mixed\\.$#" count: 1