googleanalytics
/
lib
/
analytics-admin
/
vendor
/
google
/
protobuf
/
src
/
Google
/
Protobuf
/
NullValue.php
googleanalytics
/
lib
/
analytics-admin
/
vendor
/
google
/
protobuf
/
src
/
Google
/
Protobuf
Last commit date
Field
3 years ago
Internal
2 years ago
Any.php
2 years ago
Api.php
3 years ago
BoolValue.php
3 years ago
BytesValue.php
3 years ago
Descriptor.php
2 years ago
DescriptorPool.php
2 years ago
DoubleValue.php
3 years ago
Duration.php
3 years ago
Enum.php
3 years ago
EnumDescriptor.php
2 years ago
EnumValue.php
3 years ago
EnumValueDescriptor.php
2 years ago
Field.php
3 years ago
FieldDescriptor.php
2 years ago
FieldMask.php
3 years ago
Field_Cardinality.php
3 years ago
Field_Kind.php
3 years ago
FloatValue.php
3 years ago
GPBEmpty.php
3 years ago
Int32Value.php
3 years ago
Int64Value.php
3 years ago
ListValue.php
3 years ago
Method.php
3 years ago
Mixin.php
3 years ago
NullValue.php
3 years ago
OneofDescriptor.php
2 years ago
Option.php
3 years ago
SourceContext.php
3 years ago
StringValue.php
3 years ago
Struct.php
3 years ago
Syntax.php
3 years ago
Timestamp.php
3 years ago
Type.php
3 years ago
UInt32Value.php
3 years ago
UInt64Value.php
3 years ago
Value.php
3 years ago
NullValue.php
50 lines
| 1 | <?php |
| 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! |
| 3 | # source: google/protobuf/struct.proto |
| 4 | |
| 5 | namespace Google\Protobuf; |
| 6 | |
| 7 | use UnexpectedValueException; |
| 8 | |
| 9 | /** |
| 10 | * `NullValue` is a singleton enumeration to represent the null value for the |
| 11 | * `Value` type union. |
| 12 | * The JSON representation for `NullValue` is JSON `null`. |
| 13 | * |
| 14 | * Protobuf type <code>google.protobuf.NullValue</code> |
| 15 | */ |
| 16 | class NullValue |
| 17 | { |
| 18 | /** |
| 19 | * Null value. |
| 20 | * |
| 21 | * Generated from protobuf enum <code>NULL_VALUE = 0;</code> |
| 22 | */ |
| 23 | const NULL_VALUE = 0; |
| 24 | |
| 25 | private static $valueToName = [ |
| 26 | self::NULL_VALUE => 'NULL_VALUE', |
| 27 | ]; |
| 28 | |
| 29 | public static function name($value) |
| 30 | { |
| 31 | if (!isset(self::$valueToName[$value])) { |
| 32 | throw new UnexpectedValueException(sprintf( |
| 33 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); |
| 34 | } |
| 35 | return self::$valueToName[$value]; |
| 36 | } |
| 37 | |
| 38 | |
| 39 | public static function value($name) |
| 40 | { |
| 41 | $const = __CLASS__ . '::' . strtoupper($name); |
| 42 | if (!defined($const)) { |
| 43 | throw new UnexpectedValueException(sprintf( |
| 44 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); |
| 45 | } |
| 46 | return constant($const); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 |