original_string: final public static function fromOrdinal(int $ordinal): Enum
      {
          $constants = self::getMembers();
          $item = array_slice($constants, $ordinal, 1, true);
  
          if (!$item) {
              $end = count($constants) - 1;
              $message = sprintf('Enum ordinal (%d) out of range [0, %d]', $ordinal, $end);
              throw new DomainException($message);
          }
  
          return new static(current($item));
      }
code: final public static function fromOrdinal(int $ordinal): Enum
      {
          $constants = self::getMembers();
          $item = array_slice($constants, $ordinal, 1, true);
  
          if (!$item) {
              $end = count($constants) - 1;
              $message = sprintf('Enum ordinal (%d) out of range [0, %d]', $ordinal, $end);
              throw new DomainException($message);
          }
  
          return new static(current($item));
      }
code_tokens: final public static function fromOrdinal ( int $ ordinal ) : Enum { $ constants = self :: getMembers ( ) ; $ item = array_slice ( $ constants , $ ordinal , 1 , true ) ; if ( ! $ item ) { $ end = count ( $ constants ) - 1 ; $ message = sprintf ( 'Enum ordinal (%d) out of range [0, %d]' , $ ordinal , $ end ) ; throw new DomainException ( $ message ) ; } return new static ( current ( $ item ) ) ; }
docstring: Creates instance from an enum ordinal position
  
  @param int $ordinal The enum ordinal position
  
  @return Enum
  
  @throws DomainException When the ordinal is invalid
docstring_tokens: Creates instance from an enum ordinal position