From 4bd701da2e7216bbbfe63e1ac64d249d2b4ba66a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 4 Nov 2021 08:21:09 +0100 Subject: [PATCH] ServiceStates: Param `$state` may be null --- library/Icingadb/Common/ServiceStates.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/Icingadb/Common/ServiceStates.php b/library/Icingadb/Common/ServiceStates.php index f902eaa5..526f95eb 100644 --- a/library/Icingadb/Common/ServiceStates.php +++ b/library/Icingadb/Common/ServiceStates.php @@ -56,13 +56,13 @@ class ServiceStates /** * Get the textual representation of the passed service state * - * @param int $state + * @param int|null $state * * @return string * * @throws \InvalidArgumentException If the given service state is invalid, i.e. not known */ - public static function text(int $state): string + public static function text(int $state = null): string { switch (true) { case $state === self::OK: @@ -93,13 +93,13 @@ class ServiceStates /** * Get the translated textual representation of the passed service state * - * @param int $state + * @param int|null $state * * @return string * * @throws \InvalidArgumentException If the given service state is invalid, i.e. not known */ - public static function translated(int $state): string + public static function translated(int $state = null): string { switch (true) { case $state === self::OK: