← All changes
|
includes/sdk/google/google/protobuf/src/Google/Protobuf/Syntax.php
+14
-7
1.2.8
→
1.4.2
View file →
| @@ -1,9 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | # Generated by the protocol buffer compiler. DO NOT EDIT! |
| 4 | +# NO CHECKED-IN PROTOBUF GENCODE | |
| 4 | 5 | # source: google/protobuf/type.proto |
| 5 | -namespace Dudlewebs\WPMCS\Google\Protobuf; | |
| 6 | +namespace Dudlewebs\WPMCS\GCP\Google\Protobuf; | |
| 6 | 7 | |
| 7 | 8 | use UnexpectedValueException; |
| 8 | 9 | /** |
| 9 | 10 | * The syntax in which a protocol buffer element is defined. |
| @@ -23,21 +24,27 @@ | ||
| 23 | 24 | * |
| 24 | 25 | * Generated from protobuf enum <code>SYNTAX_PROTO3 = 1;</code> |
| 25 | 26 | */ |
| 26 | 27 | const SYNTAX_PROTO3 = 1; |
| 27 | - private static $valueToName = [self::SYNTAX_PROTO2 => 'SYNTAX_PROTO2', self::SYNTAX_PROTO3 => 'SYNTAX_PROTO3']; | |
| 28 | + /** | |
| 29 | + * Syntax `editions`. | |
| 30 | + * | |
| 31 | + * Generated from protobuf enum <code>SYNTAX_EDITIONS = 2;</code> | |
| 32 | + */ | |
| 33 | + const SYNTAX_EDITIONS = 2; | |
| 34 | + private static $valueToName = [self::SYNTAX_PROTO2 => 'SYNTAX_PROTO2', self::SYNTAX_PROTO3 => 'SYNTAX_PROTO3', self::SYNTAX_EDITIONS => 'SYNTAX_EDITIONS']; | |
| 28 | 35 | public static function name($value) |
| 29 | 36 | { |
| 30 | 37 | if (!isset(self::$valueToName[$value])) { |
| 31 | - throw new UnexpectedValueException(sprintf('Enum %s has no name defined for value %s', __CLASS__, $value)); | |
| 38 | + throw new UnexpectedValueException(\sprintf('Enum %s has no name defined for value %s', __CLASS__, $value)); | |
| 32 | 39 | } |
| 33 | 40 | return self::$valueToName[$value]; |
| 34 | 41 | } |
| 35 | 42 | public static function value($name) |
| 36 | 43 | { |
| 37 | - $const = __CLASS__ . '::' . strtoupper($name); | |
| 38 | - if (!defined($const)) { | |
| 39 | - throw new UnexpectedValueException(sprintf('Enum %s has no value defined for name %s', __CLASS__, $name)); | |
| 44 | + $const = __CLASS__ . '::' . \strtoupper($name); | |
| 45 | + if (!\defined($const)) { | |
| 46 | + throw new UnexpectedValueException(\sprintf('Enum %s has no value defined for name %s', __CLASS__, $name)); | |
| 40 | 47 | } |
| 41 | - return constant($const); | |
| 48 | + return \constant($const); | |
| 42 | 49 | } |
| 43 | 50 | } |