Skip to content

Commit

Permalink
fix: phpdoc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pnal committed Jun 10, 2022
1 parent fb38e99 commit c31d336
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qtism/common/enums/AbstractEnumeration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ abstract class AbstractEnumeration implements Enumeration
{
abstract public static function asArray(): array;

/**
* @param $name
* @return false|int
*/
public static function getConstantByName($name)
{
return static::asArray()[$name] ?? false;
}

/**
* @param $constant
* @return false|string
*/
public static function getNameByConstant($constant)
{
$constants = array_flip(static::asArray());
Expand Down

0 comments on commit c31d336

Please sign in to comment.