ProblemsBadge: Don't throw exception within getTitle() & make return type optional

refs #420
This commit is contained in:
Yonas Habteab 2021-11-05 09:34:15 +01:00 committed by Johannes Meyer
parent 964b5f2f9a
commit f5304591ea

View file

@ -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;
}