lib/EnumTrait.php
final static function getIndex($value): int {
    $index = array_search($value, static::getValues(), true);
    return $index !== false ? $index : -1;
  }
final static function getIndex($value): int {
    $index = array_search($value, static::getValues(), true);
    return $index !== false ? $index : -1;
  }
final static function getIndex ( $ value ) : int { $ index = array_search ( $ value , static :: getValues ( ) , true ) ; return $ index !== false ? $ index : - 1 ; }
Gets the zero-based position of the constant in this enumeration that has the specified value.
@param mixed $value The value of a constant in this enumeration.
@return int The zero-based position of the constant that has the specified value, or `-1` if no such constant is found.
Gets the zero - based position of the constant in this enumeration that has the specified value .