Skip to content

Commit a681789

Browse files
committed
Add getKey() return type as string
1 parent 616601d commit a681789

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Enum.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ public function getValue()
8383
* Returns the enum key (i.e. the constant name).
8484
*
8585
* @psalm-pure
86-
* @return mixed
8786
*/
88-
public function getKey()
87+
public function getKey(): string
8988
{
9089
return static::search($this->value);
9190
}
@@ -200,11 +199,11 @@ public static function isValidKey($key)
200199
/**
201200
* Return key for value
202201
*
203-
* @param $value
202+
* @param mixed $value
204203
*
205204
* @psalm-param mixed $value
206205
* @psalm-pure
207-
* @return mixed
206+
* @return string|false
208207
*/
209208
public static function search($value)
210209
{

0 commit comments

Comments
 (0)