1ffe3c632Sopenharmony_ci<?php
2ffe3c632Sopenharmony_ci# Generated by the protocol buffer compiler.  DO NOT EDIT!
3ffe3c632Sopenharmony_ci# source: google/protobuf/struct.proto
4ffe3c632Sopenharmony_ci
5ffe3c632Sopenharmony_cinamespace Google\Protobuf;
6ffe3c632Sopenharmony_ci
7ffe3c632Sopenharmony_ciuse UnexpectedValueException;
8ffe3c632Sopenharmony_ci
9ffe3c632Sopenharmony_ci/**
10ffe3c632Sopenharmony_ci * `NullValue` is a singleton enumeration to represent the null value for the
11ffe3c632Sopenharmony_ci * `Value` type union.
12ffe3c632Sopenharmony_ci *  The JSON representation for `NullValue` is JSON `null`.
13ffe3c632Sopenharmony_ci *
14ffe3c632Sopenharmony_ci * Protobuf type <code>google.protobuf.NullValue</code>
15ffe3c632Sopenharmony_ci */
16ffe3c632Sopenharmony_ciclass NullValue
17ffe3c632Sopenharmony_ci{
18ffe3c632Sopenharmony_ci    /**
19ffe3c632Sopenharmony_ci     * Null value.
20ffe3c632Sopenharmony_ci     *
21ffe3c632Sopenharmony_ci     * Generated from protobuf enum <code>NULL_VALUE = 0;</code>
22ffe3c632Sopenharmony_ci     */
23ffe3c632Sopenharmony_ci    const NULL_VALUE = 0;
24ffe3c632Sopenharmony_ci
25ffe3c632Sopenharmony_ci    private static $valueToName = [
26ffe3c632Sopenharmony_ci        self::NULL_VALUE => 'NULL_VALUE',
27ffe3c632Sopenharmony_ci    ];
28ffe3c632Sopenharmony_ci
29ffe3c632Sopenharmony_ci    public static function name($value)
30ffe3c632Sopenharmony_ci    {
31ffe3c632Sopenharmony_ci        if (!isset(self::$valueToName[$value])) {
32ffe3c632Sopenharmony_ci            throw new UnexpectedValueException(sprintf(
33ffe3c632Sopenharmony_ci                    'Enum %s has no name defined for value %s', __CLASS__, $value));
34ffe3c632Sopenharmony_ci        }
35ffe3c632Sopenharmony_ci        return self::$valueToName[$value];
36ffe3c632Sopenharmony_ci    }
37ffe3c632Sopenharmony_ci
38ffe3c632Sopenharmony_ci
39ffe3c632Sopenharmony_ci    public static function value($name)
40ffe3c632Sopenharmony_ci    {
41ffe3c632Sopenharmony_ci        $const = __CLASS__ . '::' . strtoupper($name);
42ffe3c632Sopenharmony_ci        if (!defined($const)) {
43ffe3c632Sopenharmony_ci            throw new UnexpectedValueException(sprintf(
44ffe3c632Sopenharmony_ci                    'Enum %s has no value defined for name %s', __CLASS__, $name));
45ffe3c632Sopenharmony_ci        }
46ffe3c632Sopenharmony_ci        return constant($const);
47ffe3c632Sopenharmony_ci    }
48ffe3c632Sopenharmony_ci}
49ffe3c632Sopenharmony_ci
50