<?php
 
 
 

namespace Google\Protobuf\Internal\FeatureSet\VisibilityFeature;

use UnexpectedValueException;




class DefaultSymbolVisibility
{
    


    const DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;
    




    const EXPORT_ALL = 1;
    




    const EXPORT_TOP_LEVEL = 2;
    




    const LOCAL_ALL = 3;
    






    const STRICT = 4;

    private static $valueToName = [
        self::DEFAULT_SYMBOL_VISIBILITY_UNKNOWN => 'DEFAULT_SYMBOL_VISIBILITY_UNKNOWN',
        self::EXPORT_ALL => 'EXPORT_ALL',
        self::EXPORT_TOP_LEVEL => 'EXPORT_TOP_LEVEL',
        self::LOCAL_ALL => 'LOCAL_ALL',
        self::STRICT => 'STRICT',
    ];

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

