<?php
 
 
 

namespace PhpWA\Protocol\Proto\DeviceProps;

use UnexpectedValueException;




class PlatformType
{
    


    const UNKNOWN = 0;
    


    const CHROME = 1;
    


    const FIREFOX = 2;
    


    const IE = 3;
    


    const OPERA = 4;
    


    const SAFARI = 5;
    


    const EDGE = 6;
    


    const DESKTOP = 7;
    


    const IPAD = 8;
    


    const ANDROID_TABLET = 9;
    


    const OHANA = 10;
    


    const ALOHA = 11;
    


    const CATALINA = 12;
    


    const TCL_TV = 13;
    


    const IOS_PHONE = 14;
    


    const IOS_CATALYST = 15;
    


    const ANDROID_PHONE = 16;
    


    const ANDROID_AMBIGUOUS = 17;
    


    const WEAR_OS = 18;
    


    const AR_WRIST = 19;
    


    const AR_DEVICE = 20;
    


    const UWP = 21;
    


    const VR = 22;
    


    const CLOUD_API = 23;
    


    const SMARTGLASSES = 24;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::CHROME => 'CHROME',
        self::FIREFOX => 'FIREFOX',
        self::IE => 'IE',
        self::OPERA => 'OPERA',
        self::SAFARI => 'SAFARI',
        self::EDGE => 'EDGE',
        self::DESKTOP => 'DESKTOP',
        self::IPAD => 'IPAD',
        self::ANDROID_TABLET => 'ANDROID_TABLET',
        self::OHANA => 'OHANA',
        self::ALOHA => 'ALOHA',
        self::CATALINA => 'CATALINA',
        self::TCL_TV => 'TCL_TV',
        self::IOS_PHONE => 'IOS_PHONE',
        self::IOS_CATALYST => 'IOS_CATALYST',
        self::ANDROID_PHONE => 'ANDROID_PHONE',
        self::ANDROID_AMBIGUOUS => 'ANDROID_AMBIGUOUS',
        self::WEAR_OS => 'WEAR_OS',
        self::AR_WRIST => 'AR_WRIST',
        self::AR_DEVICE => 'AR_DEVICE',
        self::UWP => 'UWP',
        self::VR => 'VR',
        self::CLOUD_API => 'CLOUD_API',
        self::SMARTGLASSES => 'SMARTGLASSES',
    ];

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

