Skip to content

Commit

Permalink
Add getKey() return type as string
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Feb 10, 2021
1 parent 616601d commit a681789
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit a681789

Please sign in to comment.