From a681789b9b7cd0f7659e5807a2e5838276f5413e Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Wed, 19 Aug 2020 08:59:17 +0200 Subject: [PATCH] Add getKey() return type as string --- src/Enum.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Enum.php b/src/Enum.php index 92a42a4..1d4f7ec 100644 --- a/src/Enum.php +++ b/src/Enum.php @@ -83,9 +83,8 @@ public function getValue() * Returns the enum key (i.e. the constant name). * * @psalm-pure - * @return mixed */ - public function getKey() + public function getKey(): string { return static::search($this->value); } @@ -200,11 +199,11 @@ public static function isValidKey($key) /** * Return key for value * - * @param $value + * @param mixed $value * * @psalm-param mixed $value * @psalm-pure - * @return mixed + * @return string|false */ public static function search($value) {