public static function validate($value)
    {
        $reflector = new ReflectionClass(static::class);

        foreach ($reflector->getConstants() as $allowedValue) {
            if ($value === $allowedValue) {
                return $allowedValue;
            }
        }

        throw new ArgumentException(
            sprintf(
                'Invalid value `%s` on enum `%s`',
                $value,
                static::class
            )
        );
    }