<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: google/protobuf/descriptor.proto

namespace Google\Protobuf\Internal\FeatureSet\ProtoLimitsFeature;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.protobuf.FeatureSet.ProtoLimitsFeature.EnforceProtoLimits</code>
 */
class EnforceProtoLimits
{
    /**
     * Generated from protobuf enum <code>PROTO_LIMITS_UNKNOWN = 0;</code>
     */
    const PROTO_LIMITS_UNKNOWN = 0;
    /**
     * Default pre-EDITION_2026: there are no limit enforcement at the protoc
     * level. Practical limits still exist, but they will tend to fail while
     * compiling protoc-generated code, and these limits tend to be language
     * or toolchain specific.
     *
     * Generated from protobuf enum <code>LEGACY_NO_EXPLICIT_LIMITS = 1;</code>
     */
    const LEGACY_NO_EXPLICIT_LIMITS = 1;
    /**
     * A set of limits enforced by Edition 2026 by default. For a detailed
     * list of all the limits please consult the Edition 2026 documentation.
     *
     * Generated from protobuf enum <code>PROTO_LIMITS2026 = 2;</code>
     */
    const PROTO_LIMITS2026 = 2;

    private static $valueToName = [
        self::PROTO_LIMITS_UNKNOWN => 'PROTO_LIMITS_UNKNOWN',
        self::LEGACY_NO_EXPLICIT_LIMITS => 'LEGACY_NO_EXPLICIT_LIMITS',
        self::PROTO_LIMITS2026 => 'PROTO_LIMITS2026',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

