| 1 |
<?php |
| 2 |
# Generated by the protocol buffer compiler. DO NOT EDIT! |
| 3 |
# source: google/protobuf/type.proto |
| 4 |
|
| 5 |
namespace Google\Protobuf\Field; |
| 6 |
|
| 7 |
use UnexpectedValueException; |
| 8 |
|
| 9 |
/** |
| 10 |
* Basic field types. |
| 11 |
* |
| 12 |
* Protobuf type <code>google.protobuf.Field.Kind</code> |
| 13 |
*/ |
| 14 |
class Kind |
| 15 |
{ |
| 16 |
/** |
| 17 |
* Field type unknown. |
| 18 |
* |
| 19 |
* Generated from protobuf enum <code>TYPE_UNKNOWN = 0;</code> |
| 20 |
*/ |
| 21 |
const TYPE_UNKNOWN = 0; |
| 22 |
/** |
| 23 |
* Field type double. |
| 24 |
* |
| 25 |
* Generated from protobuf enum <code>TYPE_DOUBLE = 1;</code> |
| 26 |
*/ |
| 27 |
const TYPE_DOUBLE = 1; |
| 28 |
/** |
| 29 |
* Field type float. |
| 30 |
* |
| 31 |
* Generated from protobuf enum <code>TYPE_FLOAT = 2;</code> |
| 32 |
*/ |
| 33 |
const TYPE_FLOAT = 2; |
| 34 |
/** |
| 35 |
* Field type int64. |
| 36 |
* |
| 37 |
* Generated from protobuf enum <code>TYPE_INT64 = 3;</code> |
| 38 |
*/ |
| 39 |
const TYPE_INT64 = 3; |
| 40 |
/** |
| 41 |
* Field type uint64. |
| 42 |
* |
| 43 |
* Generated from protobuf enum <code>TYPE_UINT64 = 4;</code> |
| 44 |
*/ |
| 45 |
const TYPE_UINT64 = 4; |
| 46 |
/** |
| 47 |
* Field type int32. |
| 48 |
* |
| 49 |
* Generated from protobuf enum <code>TYPE_INT32 = 5;</code> |
| 50 |
*/ |
| 51 |
const TYPE_INT32 = 5; |
| 52 |
/** |
| 53 |
* Field type fixed64. |
| 54 |
* |
| 55 |
* Generated from protobuf enum <code>TYPE_FIXED64 = 6;</code> |
| 56 |
*/ |
| 57 |
const TYPE_FIXED64 = 6; |
| 58 |
/** |
| 59 |
* Field type fixed32. |
| 60 |
* |
| 61 |
* Generated from protobuf enum <code>TYPE_FIXED32 = 7;</code> |
| 62 |
*/ |
| 63 |
const TYPE_FIXED32 = 7; |
| 64 |
/** |
| 65 |
* Field type bool. |
| 66 |
* |
| 67 |
* Generated from protobuf enum <code>TYPE_BOOL = 8;</code> |
| 68 |
*/ |
| 69 |
const TYPE_BOOL = 8; |
| 70 |
/** |
| 71 |
* Field type string. |
| 72 |
* |
| 73 |
* Generated from protobuf enum <code>TYPE_STRING = 9;</code> |
| 74 |
*/ |
| 75 |
const TYPE_STRING = 9; |
| 76 |
/** |
| 77 |
* Field type group. Proto2 syntax only, and deprecated. |
| 78 |
* |
| 79 |
* Generated from protobuf enum <code>TYPE_GROUP = 10;</code> |
| 80 |
*/ |
| 81 |
const TYPE_GROUP = 10; |
| 82 |
/** |
| 83 |
* Field type message. |
| 84 |
* |
| 85 |
* Generated from protobuf enum <code>TYPE_MESSAGE = 11;</code> |
| 86 |
*/ |
| 87 |
const TYPE_MESSAGE = 11; |
| 88 |
/** |
| 89 |
* Field type bytes. |
| 90 |
* |
| 91 |
* Generated from protobuf enum <code>TYPE_BYTES = 12;</code> |
| 92 |
*/ |
| 93 |
const TYPE_BYTES = 12; |
| 94 |
/** |
| 95 |
* Field type uint32. |
| 96 |
* |
| 97 |
* Generated from protobuf enum <code>TYPE_UINT32 = 13;</code> |
| 98 |
*/ |
| 99 |
const TYPE_UINT32 = 13; |
| 100 |
/** |
| 101 |
* Field type enum. |
| 102 |
* |
| 103 |
* Generated from protobuf enum <code>TYPE_ENUM = 14;</code> |
| 104 |
*/ |
| 105 |
const TYPE_ENUM = 14; |
| 106 |
/** |
| 107 |
* Field type sfixed32. |
| 108 |
* |
| 109 |
* Generated from protobuf enum <code>TYPE_SFIXED32 = 15;</code> |
| 110 |
*/ |
| 111 |
const TYPE_SFIXED32 = 15; |
| 112 |
/** |
| 113 |
* Field type sfixed64. |
| 114 |
* |
| 115 |
* Generated from protobuf enum <code>TYPE_SFIXED64 = 16;</code> |
| 116 |
*/ |
| 117 |
const TYPE_SFIXED64 = 16; |
| 118 |
/** |
| 119 |
* Field type sint32. |
| 120 |
* |
| 121 |
* Generated from protobuf enum <code>TYPE_SINT32 = 17;</code> |
| 122 |
*/ |
| 123 |
const TYPE_SINT32 = 17; |
| 124 |
/** |
| 125 |
* Field type sint64. |
| 126 |
* |
| 127 |
* Generated from protobuf enum <code>TYPE_SINT64 = 18;</code> |
| 128 |
*/ |
| 129 |
const TYPE_SINT64 = 18; |
| 130 |
|
| 131 |
private static $valueToName = [ |
| 132 |
self::TYPE_UNKNOWN => 'TYPE_UNKNOWN', |
| 133 |
self::TYPE_DOUBLE => 'TYPE_DOUBLE', |
| 134 |
self::TYPE_FLOAT => 'TYPE_FLOAT', |
| 135 |
self::TYPE_INT64 => 'TYPE_INT64', |
| 136 |
self::TYPE_UINT64 => 'TYPE_UINT64', |
| 137 |
self::TYPE_INT32 => 'TYPE_INT32', |
| 138 |
self::TYPE_FIXED64 => 'TYPE_FIXED64', |
| 139 |
self::TYPE_FIXED32 => 'TYPE_FIXED32', |
| 140 |
self::TYPE_BOOL => 'TYPE_BOOL', |
| 141 |
self::TYPE_STRING => 'TYPE_STRING', |
| 142 |
self::TYPE_GROUP => 'TYPE_GROUP', |
| 143 |
self::TYPE_MESSAGE => 'TYPE_MESSAGE', |
| 144 |
self::TYPE_BYTES => 'TYPE_BYTES', |
| 145 |
self::TYPE_UINT32 => 'TYPE_UINT32', |
| 146 |
self::TYPE_ENUM => 'TYPE_ENUM', |
| 147 |
self::TYPE_SFIXED32 => 'TYPE_SFIXED32', |
| 148 |
self::TYPE_SFIXED64 => 'TYPE_SFIXED64', |
| 149 |
self::TYPE_SINT32 => 'TYPE_SINT32', |
| 150 |
self::TYPE_SINT64 => 'TYPE_SINT64', |
| 151 |
]; |
| 152 |
|
| 153 |
public static function name($value) |
| 154 |
{ |
| 155 |
if (!isset(self::$valueToName[$value])) { |
| 156 |
throw new UnexpectedValueException(sprintf( |
| 157 |
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
| 158 |
} |
| 159 |
return self::$valueToName[$value]; |
| 160 |
} |
| 161 |
|
| 162 |
|
| 163 |
public static function value($name) |
| 164 |
{ |
| 165 |
$const = __CLASS__ . '::' . strtoupper($name); |
| 166 |
if (!defined($const)) { |
| 167 |
throw new UnexpectedValueException(sprintf( |
| 168 |
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
| 169 |
} |
| 170 |
return constant($const); |
| 171 |
} |
| 172 |
} |
| 173 |
|
| 174 |
// Adding a class alias for backwards compatibility with the previous class name. |
| 175 |
class_alias(Kind::class, \Google\Protobuf\Field_Kind::class); |
| 176 |
|