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));
    }