From f5304591eaef6b0e80a0413f72cfbcb9b4024734 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 5 Nov 2021 09:34:15 +0100 Subject: [PATCH] ProblemsBadge: Don't throw exception within `getTitle()` & make return type optional refs #420 --- .../Icingadb/Web/Navigation/Renderer/ProblemsBadge.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php b/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php index b7386c03..0292c536 100644 --- a/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php +++ b/library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php @@ -107,16 +107,10 @@ abstract class ProblemsBadge extends NavigationItemRenderer /** * Get the title * - * @return string + * @return ?string */ - public function getTitle(): string + public function getTitle() { - if ($this->title === null) { - throw new \LogicException( - 'You are accessing an unset property. Please make sure to set it beforehand.' - ); - } - return $this->title; }