<?php
 
 
 

namespace PhpWA\Protocol\Proto\PatchDebugData;

use UnexpectedValueException;




class Platform
{
    


    const ANDROID = 0;
    


    const SMBA = 1;
    


    const IPHONE = 2;
    


    const SMBI = 3;
    


    const WEB = 4;
    


    const UWP = 5;
    


    const DARWIN = 6;
    


    const IPAD = 7;
    


    const WEAROS = 8;
    


    const WASG = 9;
    


    const WEARM = 10;
    


    const CAPI = 11;

    private static $valueToName = [
        self::ANDROID => 'ANDROID',
        self::SMBA => 'SMBA',
        self::IPHONE => 'IPHONE',
        self::SMBI => 'SMBI',
        self::WEB => 'WEB',
        self::UWP => 'UWP',
        self::DARWIN => 'DARWIN',
        self::IPAD => 'IPAD',
        self::WEAROS => 'WEAROS',
        self::WASG => 'WASG',
        self::WEARM => 'WEARM',
        self::CAPI => 'CAPI',
    ];

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

