private static function constant(string $name)
    {
        $constant = static::class . '::' . $name;

        if (!defined($constant)) {
            $message = sprintf('Enum %s does not contain value named %s.', static::class, $name);
            throw new InvalidArgumentException($message);
        }

        return constant($constant);
    }
private static function constant(string $name)
    {
        $constant = static::class . '::' . $name;

        if (!defined($constant)) {
            $message = sprintf('Enum %s does not contain value named %s.', static::class, $name);
            throw new InvalidArgumentException($message);
        }

        return constant($constant);
    }
private static function constant ( string $ name ) { $ constant = static :: class . '::' . $ name ; if ( ! defined ( $ constant ) ) { $ message = sprintf ( 'Enum %s does not contain value named %s.' , static :: class , $ name ) ; throw new InvalidArgumentException ( $ message ) ; } return constant ( $ constant ) ; }
Get the value of the given constant.

@param string $name The name of the constant.

@return mixed The value of the given constant.

@throws InvalidArgumentException If no such constant exists.
Get the value of the given constant .