Commit 46ae90dc authored by Paul Yang's avatar Paul Yang Committed by GitHub

Make php generated code conform to PSR-4. (#2435)

1. Generate single file for each message.
2. Lazily initiate metadata.
parent 631f4618
......@@ -122,8 +122,7 @@ conformance/succeeding_tests.txt
# php test output
composer.lock
php/tests/test.pb.php
php/tests/test_include.pb.php
php/tests/generated/
php/ext/google/protobuf/.libs/
php/ext/google/protobuf/Makefile.fragments
php/ext/google/protobuf/Makefile.global
......
......@@ -575,58 +575,88 @@ objectivec_EXTRA_DIST= \
objectivec/Tests/UnitTests-Info.plist \
Protobuf.podspec
php_EXTRA_DIST= \
php/src/phpdoc.dist.xml \
php/src/Google/Protobuf/Internal/DescriptorPool.php \
php/src/Google/Protobuf/Internal/OneofField.php \
php/src/Google/Protobuf/Internal/MapEntry.php \
php/src/Google/Protobuf/Internal/InputStream.php \
php/src/Google/Protobuf/Internal/OutputStream.php \
php/src/Google/Protobuf/Internal/MessageBuilderContext.php \
php/src/Google/Protobuf/Internal/MapField.php \
php/src/Google/Protobuf/Internal/RepeatedField.php \
php/src/Google/Protobuf/Internal/Message.php \
php/src/Google/Protobuf/Internal/GPBWire.php \
php/src/Google/Protobuf/Internal/GPBType.php \
php/src/Google/Protobuf/Internal/GPBLabel.php \
php/src/Google/Protobuf/Internal/EnumBuilderContext.php \
php/src/Google/Protobuf/Internal/GPBUtil.php \
php/src/Google/Protobuf/descriptor_internal.pb.php \
php/src/Google/Protobuf/descriptor.php \
php/tests/encode_decode_test.php \
php/tests/test.sh \
php/tests/generated_class_test.php \
php/tests/array_test.php \
php/tests/php_implementation_test.php \
php/tests/test_include.proto \
php/tests/test_include.pb.php \
php/tests/map_field_test.php \
php/tests/test_base.php \
php/tests/test_no_namespace.proto \
php/tests/test_no_namespace.pb.php \
php/tests/test_util.php \
php/tests/test.proto \
php/tests/test.pb.php \
php/tests/memory_leak_test.php \
php/tests/google/protobuf/empty.pb.php \
php/tests/well_known_test.php \
php/README.md \
php/ext/google/protobuf/utf8.h \
php/ext/google/protobuf/message.c \
php/ext/google/protobuf/utf8.c \
php/ext/google/protobuf/package.xml \
php/ext/google/protobuf/upb.h \
php/ext/google/protobuf/array.c \
php/ext/google/protobuf/encode_decode.c \
php/ext/google/protobuf/protobuf.h \
php/ext/google/protobuf/type_check.c \
php/ext/google/protobuf/def.c \
php/ext/google/protobuf/storage.c \
php/ext/google/protobuf/map.c \
php/ext/google/protobuf/config.m4 \
php/ext/google/protobuf/upb.c \
php/ext/google/protobuf/protobuf.c \
phpunit.xml \
php_EXTRA_DIST= \
php/src/phpdoc.dist.xml \
php/src/Google/Protobuf/Internal/DescriptorPool.php \
php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php \
php/src/Google/Protobuf/Internal/OneofField.php \
php/src/Google/Protobuf/Internal/MessageOptions.php \
php/src/Google/Protobuf/Internal/FileDescriptorProto.php \
php/src/Google/Protobuf/Internal/MapEntry.php \
php/src/Google/Protobuf/Internal/FieldDescriptorProto.php \
php/src/Google/Protobuf/Internal/InputStream.php \
php/src/Google/Protobuf/Internal/UninterpretedOption.php \
php/src/Google/Protobuf/Internal/ServiceOptions.php \
php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php \
php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php \
php/src/Google/Protobuf/Internal/OneofDescriptorProto.php \
php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php \
php/src/Google/Protobuf/Internal/OutputStream.php \
php/src/Google/Protobuf/Internal/MessageBuilderContext.php \
php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php \
php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php \
php/src/Google/Protobuf/Internal/DescriptorProto.php \
php/src/Google/Protobuf/Internal/MapField.php \
php/src/Google/Protobuf/Internal/MethodDescriptorProto.php \
php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \
php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php \
php/src/Google/Protobuf/Internal/RepeatedField.php \
php/src/Google/Protobuf/Internal/EnumValueOptions.php \
php/src/Google/Protobuf/Internal/MethodOptions.php \
php/src/Google/Protobuf/Internal/OneofOptions.php \
php/src/Google/Protobuf/Internal/Message.php \
php/src/Google/Protobuf/Internal/FileOptions.php \
php/src/Google/Protobuf/Internal/FileDescriptorSet.php \
php/src/Google/Protobuf/Internal/EnumDescriptorProto.php \
php/src/Google/Protobuf/Internal/GPBWire.php \
php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php \
php/src/Google/Protobuf/Internal/FieldOptions.php \
php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php \
php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php \
php/src/Google/Protobuf/Internal/GPBType.php \
php/src/Google/Protobuf/Internal/FieldOptions_JSType.php \
php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php \
php/src/Google/Protobuf/Internal/SourceCodeInfo.php \
php/src/Google/Protobuf/Internal/EnumOptions.php \
php/src/Google/Protobuf/Internal/GPBLabel.php \
php/src/Google/Protobuf/Internal/EnumBuilderContext.php \
php/src/Google/Protobuf/Internal/GPBUtil.php \
php/src/Google/Protobuf/Internal/FieldOptions_CType.php \
php/src/Google/Protobuf/descriptor.php \
php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php \
php/tests/autoload.php \
php/tests/encode_decode_test.php \
php/tests/test.sh \
php/tests/gdb_test.sh \
php/tests/generated_class_test.php \
php/tests/array_test.php \
php/tests/php_implementation_test.php \
php/tests/proto/test_include.proto \
php/tests/map_field_test.php \
php/tests/test_base.php \
php/tests/proto/test_no_namespace.proto \
php/tests/test_util.php \
php/tests/proto/test.proto \
php/tests/memory_leak_test.php \
php/tests/well_known_test.php \
php/README.md \
php/ext/google/protobuf/utf8.h \
php/ext/google/protobuf/message.c \
php/ext/google/protobuf/utf8.c \
php/ext/google/protobuf/package.xml \
php/ext/google/protobuf/upb.h \
php/ext/google/protobuf/array.c \
php/ext/google/protobuf/encode_decode.c \
php/ext/google/protobuf/protobuf.h \
php/ext/google/protobuf/type_check.c \
php/ext/google/protobuf/def.c \
php/ext/google/protobuf/storage.c \
php/ext/google/protobuf/map.c \
php/ext/google/protobuf/config.m4 \
php/ext/google/protobuf/upb.c \
php/ext/google/protobuf/protobuf.c \
php/phpunit.xml \
php/composer.json \
composer.json
python_EXTRA_DIST= \
......
......@@ -13,11 +13,11 @@
},
"autoload": {
"psr-4": {
"Google\\": "php/src/Google"
"Google\\Protobuf\\Internal\\": "src/Google/Protobuf/Internal",
"GPBMetadata\\Google\\Protobuf\\Internal\\": "src/GPBMetadata/Google/Protobuf/Internal"
},
"files": [
"php/src/Google/Protobuf/descriptor.php",
"php/src/Google/Protobuf/descriptor_internal.pb.php"
"src/Google/Protobuf/descriptor.php"
]
}
}
......@@ -148,7 +148,7 @@ RUN php composer-setup.php
RUN mv composer.phar /usr/bin/composer
RUN php -r "unlink('composer-setup.php');"
RUN cd /tmp && \
cd protobuf && \
cd protobuf/php && \
ln -sfn /usr/bin/php5.5 /usr/bin/php && \
ln -sfn /usr/bin/php-config5.5 /usr/bin/php-config && \
ln -sfn /usr/bin/phpize5.5 /usr/bin/phpize && \
......
......@@ -63,7 +63,7 @@ RUN mv composer.phar /usr/bin/composer
RUN php -r "unlink('composer-setup.php');"
RUN cd /tmp && \
git clone https://github.com/google/protobuf.git && \
cd protobuf && \
cd protobuf/php && \
git reset 734930f9197b7bc97c3c794c7a949fee2a08c280 && \
ln -sfn /usr/bin/php5.5 /usr/bin/php && \
ln -sfn /usr/bin/php-config5.5 /usr/bin/php-config && \
......
{
"name": "google/protobuf",
"type": "library",
"description": "proto library for PHP",
"keywords": ["proto"],
"homepage": "https://developers.google.com/protocol-buffers/",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.8.0"
},
"autoload": {
"psr-4": {
"Foo\\": "tests/generated/Foo",
"Bar\\": "tests/generated/Bar",
"Google\\Protobuf\\": "tests/generated/Google/Protobuf",
"Google\\Protobuf\\Internal\\": "src/Google/Protobuf/Internal",
"GPBMetadata\\": "tests/generated/GPBMetadata",
"GPBMetadata\\Google\\Protobuf\\Internal\\": "src/GPBMetadata/Google/Protobuf/Internal"
},
"files": [
"src/Google/Protobuf/descriptor.php"
]
}
}
......@@ -41,6 +41,7 @@ static zend_function_entry message_methods[] = {
PHP_ME(Message, decode, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Message, readOneof, NULL, ZEND_ACC_PROTECTED)
PHP_ME(Message, writeOneof, NULL, ZEND_ACC_PROTECTED)
PHP_ME(Message, __construct, NULL, ZEND_ACC_PROTECTED)
{NULL, NULL, NULL}
};
......@@ -210,6 +211,17 @@ void build_class_from_descriptor(zval* php_descriptor TSRMLS_DC) {
// PHP Methods
// -----------------------------------------------------------------------------
// At the first time the message is created, the class entry hasn't been
// modified. As a result, the first created instance will be a normal zend
// object. Here, we manually modify it to our message in such a case.
PHP_METHOD(Message, __construct) {
if (Z_OBJVAL_P(getThis()).handlers != message_handlers) {
zend_class_entry* ce = Z_OBJCE_P(getThis());
zval_dtor(getThis());
Z_OBJVAL_P(getThis()) = message_create(ce TSRMLS_CC);
}
}
PHP_METHOD(Message, readOneof) {
long index;
......
......@@ -231,8 +231,8 @@ struct MessageHeader {
};
MessageLayout* create_layout(const upb_msgdef* msgdef);
void layout_init(MessageLayout* layout, void* storage, zval** properties_table
TSRMLS_DC);
void layout_init(MessageLayout* layout, void* storage,
zval** properties_table TSRMLS_DC);
zval* layout_get(MessageLayout* layout, const void* storage,
const upb_fielddef* field, zval** cache TSRMLS_DC);
void layout_set(MessageLayout* layout, MessageHeader* header,
......@@ -241,6 +241,7 @@ void free_layout(MessageLayout* layout);
PHP_METHOD(Message, readOneof);
PHP_METHOD(Message, writeOneof);
PHP_METHOD(Message, __construct);
// -----------------------------------------------------------------------------
// Encode / Decode.
......
......@@ -458,8 +458,8 @@ void free_layout(MessageLayout* layout) {
FREE(layout);
}
void layout_init(MessageLayout* layout, void* storage, zval** properties_table
TSRMLS_DC) {
void layout_init(MessageLayout* layout, void* storage,
zval** properties_table TSRMLS_DC) {
int i;
upb_msg_field_iter it;
for (upb_msg_field_begin(&it, layout->msgdef), i = 0; !upb_msg_field_done(&it);
......@@ -479,8 +479,8 @@ void layout_init(MessageLayout* layout, void* storage, zval** properties_table
DEREF(memory, zval**) = property_ptr;
} else if (upb_fielddef_label(field) == UPB_LABEL_REPEATED) {
zval_ptr_dtor(property_ptr);
repeated_field_create_with_type(repeated_field_type, field, property_ptr
TSRMLS_CC);
repeated_field_create_with_type(repeated_field_type, field,
property_ptr TSRMLS_CC);
DEREF(memory, zval**) = property_ptr;
} else {
native_slot_init(upb_fielddef_type(field), memory, property_ptr);
......
......@@ -3,12 +3,12 @@
colors="true">
<testsuites>
<testsuite name="protobuf-tests">
<file>php/tests/php_implementation_test.php</file>
<file>php/tests/array_test.php</file>
<file>php/tests/encode_decode_test.php</file>
<file>php/tests/generated_class_test.php</file>
<file>php/tests/map_field_test.php</file>
<file>php/tests/well_known_test.php</file>
<file>tests/php_implementation_test.php</file>
<file>tests/array_test.php</file>
<file>tests/encode_decode_test.php</file>
<file>tests/generated_class_test.php</file>
<file>tests/map_field_test.php</file>
<file>tests/well_known_test.php</file>
</testsuite>
</testsuites>
</phpunit>
This diff is collapsed.
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* <pre>
* Describes a message type.
* </pre>
*
* Protobuf type <code>google.protobuf.DescriptorProto</code>
*/
class DescriptorProto extends \Google\Protobuf\Internal\Message
{
/**
* <code>optional string name = 1;</code>
*/
private $name = '';
private $has_name = false;
/**
* <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
*/
private $field;
private $has_field = false;
/**
* <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
*/
private $extension;
private $has_extension = false;
/**
* <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
*/
private $nested_type;
private $has_nested_type = false;
/**
* <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
*/
private $enum_type;
private $has_enum_type = false;
/**
* <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
*/
private $extension_range;
private $has_extension_range = false;
/**
* <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
*/
private $oneof_decl;
private $has_oneof_decl = false;
/**
* <code>optional .google.protobuf.MessageOptions options = 7;</code>
*/
private $options = null;
private $has_options = false;
/**
* <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
*/
private $reserved_range;
private $has_reserved_range = false;
/**
* <pre>
* Reserved field names, which may not be used by fields in the same message.
* A given name may only be reserved once.
* </pre>
*
* <code>repeated string reserved_name = 10;</code>
*/
private $reserved_name;
private $has_reserved_name = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <code>optional string name = 1;</code>
*/
public function getName()
{
return $this->name;
}
/**
* <code>optional string name = 1;</code>
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
$this->has_name = true;
}
public function hasName()
{
return $this->has_name;
}
/**
* <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
*/
public function getField()
{
return $this->field;
}
/**
* <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
*/
public function setField(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
$this->field = $var;
$this->has_field = true;
}
public function hasField()
{
return $this->has_field;
}
/**
* <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
*/
public function getExtension()
{
return $this->extension;
}
/**
* <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
*/
public function setExtension(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
$this->extension = $var;
$this->has_extension = true;
}
public function hasExtension()
{
return $this->has_extension;
}
/**
* <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
*/
public function getNestedType()
{
return $this->nested_type;
}
/**
* <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
*/
public function setNestedType(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
$this->nested_type = $var;
$this->has_nested_type = true;
}
public function hasNestedType()
{
return $this->has_nested_type;
}
/**
* <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
*/
public function getEnumType()
{
return $this->enum_type;
}
/**
* <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
*/
public function setEnumType(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class);
$this->enum_type = $var;
$this->has_enum_type = true;
}
public function hasEnumType()
{
return $this->has_enum_type;
}
/**
* <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
*/
public function getExtensionRange()
{
return $this->extension_range;
}
/**
* <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
*/
public function setExtensionRange(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto_ExtensionRange::class);
$this->extension_range = $var;
$this->has_extension_range = true;
}
public function hasExtensionRange()
{
return $this->has_extension_range;
}
/**
* <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
*/
public function getOneofDecl()
{
return $this->oneof_decl;
}
/**
* <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
*/
public function setOneofDecl(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\OneofDescriptorProto::class);
$this->oneof_decl = $var;
$this->has_oneof_decl = true;
}
public function hasOneofDecl()
{
return $this->has_oneof_decl;
}
/**
* <code>optional .google.protobuf.MessageOptions options = 7;</code>
*/
public function getOptions()
{
return $this->options;
}
/**
* <code>optional .google.protobuf.MessageOptions options = 7;</code>
*/
public function setOptions(&$var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MessageOptions::class);
$this->options = $var;
$this->has_options = true;
}
public function hasOptions()
{
return $this->has_options;
}
/**
* <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
*/
public function getReservedRange()
{
return $this->reserved_range;
}
/**
* <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
*/
public function setReservedRange(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto_ReservedRange::class);
$this->reserved_range = $var;
$this->has_reserved_range = true;
}
public function hasReservedRange()
{
return $this->has_reserved_range;
}
/**
* <pre>
* Reserved field names, which may not be used by fields in the same message.
* A given name may only be reserved once.
* </pre>
*
* <code>repeated string reserved_name = 10;</code>
*/
public function getReservedName()
{
return $this->reserved_name;
}
/**
* <pre>
* Reserved field names, which may not be used by fields in the same message.
* A given name may only be reserved once.
* </pre>
*
* <code>repeated string reserved_name = 10;</code>
*/
public function setReservedName(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->reserved_name = $var;
$this->has_reserved_name = true;
}
public function hasReservedName()
{
return $this->has_reserved_name;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* Protobuf type <code>google.protobuf.DescriptorProto.ExtensionRange</code>
*/
class DescriptorProto_ExtensionRange extends \Google\Protobuf\Internal\Message
{
/**
* <code>optional int32 start = 1;</code>
*/
private $start = 0;
private $has_start = false;
/**
* <code>optional int32 end = 2;</code>
*/
private $end = 0;
private $has_end = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <code>optional int32 start = 1;</code>
*/
public function getStart()
{
return $this->start;
}
/**
* <code>optional int32 start = 1;</code>
*/
public function setStart($var)
{
GPBUtil::checkInt32($var);
$this->start = $var;
$this->has_start = true;
}
public function hasStart()
{
return $this->has_start;
}
/**
* <code>optional int32 end = 2;</code>
*/
public function getEnd()
{
return $this->end;
}
/**
* <code>optional int32 end = 2;</code>
*/
public function setEnd($var)
{
GPBUtil::checkInt32($var);
$this->end = $var;
$this->has_end = true;
}
public function hasEnd()
{
return $this->has_end;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* <pre>
* Range of reserved tag numbers. Reserved tag numbers may not be used by
* fields or extension ranges in the same message. Reserved ranges may
* not overlap.
* </pre>
*
* Protobuf type <code>google.protobuf.DescriptorProto.ReservedRange</code>
*/
class DescriptorProto_ReservedRange extends \Google\Protobuf\Internal\Message
{
/**
* <pre>
* Inclusive.
* </pre>
*
* <code>optional int32 start = 1;</code>
*/
private $start = 0;
private $has_start = false;
/**
* <pre>
* Exclusive.
* </pre>
*
* <code>optional int32 end = 2;</code>
*/
private $end = 0;
private $has_end = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <pre>
* Inclusive.
* </pre>
*
* <code>optional int32 start = 1;</code>
*/
public function getStart()
{
return $this->start;
}
/**
* <pre>
* Inclusive.
* </pre>
*
* <code>optional int32 start = 1;</code>
*/
public function setStart($var)
{
GPBUtil::checkInt32($var);
$this->start = $var;
$this->has_start = true;
}
public function hasStart()
{
return $this->has_start;
}
/**
* <pre>
* Exclusive.
* </pre>
*
* <code>optional int32 end = 2;</code>
*/
public function getEnd()
{
return $this->end;
}
/**
* <pre>
* Exclusive.
* </pre>
*
* <code>optional int32 end = 2;</code>
*/
public function setEnd($var)
{
GPBUtil::checkInt32($var);
$this->end = $var;
$this->has_end = true;
}
public function hasEnd()
{
return $this->has_end;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* <pre>
* Describes an enum type.
* </pre>
*
* Protobuf type <code>google.protobuf.EnumDescriptorProto</code>
*/
class EnumDescriptorProto extends \Google\Protobuf\Internal\Message
{
/**
* <code>optional string name = 1;</code>
*/
private $name = '';
private $has_name = false;
/**
* <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
*/
private $value;
private $has_value = false;
/**
* <code>optional .google.protobuf.EnumOptions options = 3;</code>
*/
private $options = null;
private $has_options = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <code>optional string name = 1;</code>
*/
public function getName()
{
return $this->name;
}
/**
* <code>optional string name = 1;</code>
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
$this->has_name = true;
}
public function hasName()
{
return $this->has_name;
}
/**
* <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
*/
public function getValue()
{
return $this->value;
}
/**
* <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
*/
public function setValue(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class);
$this->value = $var;
$this->has_value = true;
}
public function hasValue()
{
return $this->has_value;
}
/**
* <code>optional .google.protobuf.EnumOptions options = 3;</code>
*/
public function getOptions()
{
return $this->options;
}
/**
* <code>optional .google.protobuf.EnumOptions options = 3;</code>
*/
public function setOptions(&$var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class);
$this->options = $var;
$this->has_options = true;
}
public function hasOptions()
{
return $this->has_options;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* Protobuf type <code>google.protobuf.EnumOptions</code>
*/
class EnumOptions extends \Google\Protobuf\Internal\Message
{
/**
* <pre>
* Set this option to true to allow mapping different tag names to the same
* value.
* </pre>
*
* <code>optional bool allow_alias = 2;</code>
*/
private $allow_alias = false;
private $has_allow_alias = false;
/**
* <pre>
* Is this enum deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the enum, or it will be completely ignored; in the very least, this
* is a formalization for deprecating enums.
* </pre>
*
* <code>optional bool deprecated = 3 [default = false];</code>
*/
private $deprecated = false;
private $has_deprecated = false;
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
private $uninterpreted_option;
private $has_uninterpreted_option = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <pre>
* Set this option to true to allow mapping different tag names to the same
* value.
* </pre>
*
* <code>optional bool allow_alias = 2;</code>
*/
public function getAllowAlias()
{
return $this->allow_alias;
}
/**
* <pre>
* Set this option to true to allow mapping different tag names to the same
* value.
* </pre>
*
* <code>optional bool allow_alias = 2;</code>
*/
public function setAllowAlias($var)
{
GPBUtil::checkBool($var);
$this->allow_alias = $var;
$this->has_allow_alias = true;
}
public function hasAllowAlias()
{
return $this->has_allow_alias;
}
/**
* <pre>
* Is this enum deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the enum, or it will be completely ignored; in the very least, this
* is a formalization for deprecating enums.
* </pre>
*
* <code>optional bool deprecated = 3 [default = false];</code>
*/
public function getDeprecated()
{
return $this->deprecated;
}
/**
* <pre>
* Is this enum deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the enum, or it will be completely ignored; in the very least, this
* is a formalization for deprecating enums.
* </pre>
*
* <code>optional bool deprecated = 3 [default = false];</code>
*/
public function setDeprecated($var)
{
GPBUtil::checkBool($var);
$this->deprecated = $var;
$this->has_deprecated = true;
}
public function hasDeprecated()
{
return $this->has_deprecated;
}
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
public function getUninterpretedOption()
{
return $this->uninterpreted_option;
}
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
public function setUninterpretedOption(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
$this->uninterpreted_option = $var;
$this->has_uninterpreted_option = true;
}
public function hasUninterpretedOption()
{
return $this->has_uninterpreted_option;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* <pre>
* Describes a value within an enum.
* </pre>
*
* Protobuf type <code>google.protobuf.EnumValueDescriptorProto</code>
*/
class EnumValueDescriptorProto extends \Google\Protobuf\Internal\Message
{
/**
* <code>optional string name = 1;</code>
*/
private $name = '';
private $has_name = false;
/**
* <code>optional int32 number = 2;</code>
*/
private $number = 0;
private $has_number = false;
/**
* <code>optional .google.protobuf.EnumValueOptions options = 3;</code>
*/
private $options = null;
private $has_options = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <code>optional string name = 1;</code>
*/
public function getName()
{
return $this->name;
}
/**
* <code>optional string name = 1;</code>
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
$this->has_name = true;
}
public function hasName()
{
return $this->has_name;
}
/**
* <code>optional int32 number = 2;</code>
*/
public function getNumber()
{
return $this->number;
}
/**
* <code>optional int32 number = 2;</code>
*/
public function setNumber($var)
{
GPBUtil::checkInt32($var);
$this->number = $var;
$this->has_number = true;
}
public function hasNumber()
{
return $this->has_number;
}
/**
* <code>optional .google.protobuf.EnumValueOptions options = 3;</code>
*/
public function getOptions()
{
return $this->options;
}
/**
* <code>optional .google.protobuf.EnumValueOptions options = 3;</code>
*/
public function setOptions(&$var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumValueOptions::class);
$this->options = $var;
$this->has_options = true;
}
public function hasOptions()
{
return $this->has_options;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* Protobuf type <code>google.protobuf.EnumValueOptions</code>
*/
class EnumValueOptions extends \Google\Protobuf\Internal\Message
{
/**
* <pre>
* Is this enum value deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the enum value, or it will be completely ignored; in the very least,
* this is a formalization for deprecating enum values.
* </pre>
*
* <code>optional bool deprecated = 1 [default = false];</code>
*/
private $deprecated = false;
private $has_deprecated = false;
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
private $uninterpreted_option;
private $has_uninterpreted_option = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <pre>
* Is this enum value deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the enum value, or it will be completely ignored; in the very least,
* this is a formalization for deprecating enum values.
* </pre>
*
* <code>optional bool deprecated = 1 [default = false];</code>
*/
public function getDeprecated()
{
return $this->deprecated;
}
/**
* <pre>
* Is this enum value deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the enum value, or it will be completely ignored; in the very least,
* this is a formalization for deprecating enum values.
* </pre>
*
* <code>optional bool deprecated = 1 [default = false];</code>
*/
public function setDeprecated($var)
{
GPBUtil::checkBool($var);
$this->deprecated = $var;
$this->has_deprecated = true;
}
public function hasDeprecated()
{
return $this->has_deprecated;
}
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
public function getUninterpretedOption()
{
return $this->uninterpreted_option;
}
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
public function setUninterpretedOption(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
$this->uninterpreted_option = $var;
$this->has_uninterpreted_option = true;
}
public function hasUninterpretedOption()
{
return $this->has_uninterpreted_option;
}
}
This diff is collapsed.
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
/**
* Protobuf enum <code>google.protobuf.FieldDescriptorProto.Label</code>
*/
namespace Google\Protobuf\Internal;
class FieldDescriptorProto_Label
{
/**
* <pre>
* 0 is reserved for errors
* </pre>
*
* <code>LABEL_OPTIONAL = 1;</code>
*/
const LABEL_OPTIONAL = 1;
/**
* <code>LABEL_REQUIRED = 2;</code>
*/
const LABEL_REQUIRED = 2;
/**
* <code>LABEL_REPEATED = 3;</code>
*/
const LABEL_REPEATED = 3;
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
/**
* Protobuf enum <code>google.protobuf.FieldDescriptorProto.Type</code>
*/
namespace Google\Protobuf\Internal;
class FieldDescriptorProto_Type
{
/**
* <pre>
* 0 is reserved for errors.
* Order is weird for historical reasons.
* </pre>
*
* <code>TYPE_DOUBLE = 1;</code>
*/
const TYPE_DOUBLE = 1;
/**
* <code>TYPE_FLOAT = 2;</code>
*/
const TYPE_FLOAT = 2;
/**
* <pre>
* Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
* negative values are likely.
* </pre>
*
* <code>TYPE_INT64 = 3;</code>
*/
const TYPE_INT64 = 3;
/**
* <code>TYPE_UINT64 = 4;</code>
*/
const TYPE_UINT64 = 4;
/**
* <pre>
* Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
* negative values are likely.
* </pre>
*
* <code>TYPE_INT32 = 5;</code>
*/
const TYPE_INT32 = 5;
/**
* <code>TYPE_FIXED64 = 6;</code>
*/
const TYPE_FIXED64 = 6;
/**
* <code>TYPE_FIXED32 = 7;</code>
*/
const TYPE_FIXED32 = 7;
/**
* <code>TYPE_BOOL = 8;</code>
*/
const TYPE_BOOL = 8;
/**
* <code>TYPE_STRING = 9;</code>
*/
const TYPE_STRING = 9;
/**
* <pre>
* Tag-delimited aggregate.
* </pre>
*
* <code>TYPE_GROUP = 10;</code>
*/
const TYPE_GROUP = 10;
/**
* <pre>
* Length-delimited aggregate.
* </pre>
*
* <code>TYPE_MESSAGE = 11;</code>
*/
const TYPE_MESSAGE = 11;
/**
* <pre>
* New in version 2.
* </pre>
*
* <code>TYPE_BYTES = 12;</code>
*/
const TYPE_BYTES = 12;
/**
* <code>TYPE_UINT32 = 13;</code>
*/
const TYPE_UINT32 = 13;
/**
* <code>TYPE_ENUM = 14;</code>
*/
const TYPE_ENUM = 14;
/**
* <code>TYPE_SFIXED32 = 15;</code>
*/
const TYPE_SFIXED32 = 15;
/**
* <code>TYPE_SFIXED64 = 16;</code>
*/
const TYPE_SFIXED64 = 16;
/**
* <pre>
* Uses ZigZag encoding.
* </pre>
*
* <code>TYPE_SINT32 = 17;</code>
*/
const TYPE_SINT32 = 17;
/**
* <pre>
* Uses ZigZag encoding.
* </pre>
*
* <code>TYPE_SINT64 = 18;</code>
*/
const TYPE_SINT64 = 18;
}
This diff is collapsed.
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
/**
* Protobuf enum <code>google.protobuf.FieldOptions.CType</code>
*/
namespace Google\Protobuf\Internal;
class FieldOptions_CType
{
/**
* <pre>
* Default mode.
* </pre>
*
* <code>STRING = 0;</code>
*/
const STRING = 0;
/**
* <code>CORD = 1;</code>
*/
const CORD = 1;
/**
* <code>STRING_PIECE = 2;</code>
*/
const STRING_PIECE = 2;
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
/**
* Protobuf enum <code>google.protobuf.FieldOptions.JSType</code>
*/
namespace Google\Protobuf\Internal;
class FieldOptions_JSType
{
/**
* <pre>
* Use the default type.
* </pre>
*
* <code>JS_NORMAL = 0;</code>
*/
const JS_NORMAL = 0;
/**
* <pre>
* Use JavaScript strings.
* </pre>
*
* <code>JS_STRING = 1;</code>
*/
const JS_STRING = 1;
/**
* <pre>
* Use JavaScript numbers.
* </pre>
*
* <code>JS_NUMBER = 2;</code>
*/
const JS_NUMBER = 2;
}
This diff is collapsed.
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* <pre>
* The protocol compiler can output a FileDescriptorSet containing the .proto
* files it parses.
* </pre>
*
* Protobuf type <code>google.protobuf.FileDescriptorSet</code>
*/
class FileDescriptorSet extends \Google\Protobuf\Internal\Message
{
/**
* <code>repeated .google.protobuf.FileDescriptorProto file = 1;</code>
*/
private $file;
private $has_file = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <code>repeated .google.protobuf.FileDescriptorProto file = 1;</code>
*/
public function getFile()
{
return $this->file;
}
/**
* <code>repeated .google.protobuf.FileDescriptorProto file = 1;</code>
*/
public function setFile(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FileDescriptorProto::class);
$this->file = $var;
$this->has_file = true;
}
public function hasFile()
{
return $this->has_file;
}
}
This diff is collapsed.
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
/**
* <pre>
* Generated classes can be optimized for speed or code size.
* </pre>
*
* Protobuf enum <code>google.protobuf.FileOptions.OptimizeMode</code>
*/
namespace Google\Protobuf\Internal;
class FileOptions_OptimizeMode
{
/**
* <pre>
* Generate complete code for parsing, serialization,
* </pre>
*
* <code>SPEED = 1;</code>
*/
const SPEED = 1;
/**
* <pre>
* etc.
* </pre>
*
* <code>CODE_SIZE = 2;</code>
*/
const CODE_SIZE = 2;
/**
* <pre>
* Generate code using MessageLite and the lite runtime.
* </pre>
*
* <code>LITE_RUNTIME = 3;</code>
*/
const LITE_RUNTIME = 3;
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* <pre>
* Describes the relationship between generated code and its original source
* file. A GeneratedCodeInfo message is associated with only one generated
* source file, but may contain references to different source .proto files.
* </pre>
*
* Protobuf type <code>google.protobuf.GeneratedCodeInfo</code>
*/
class GeneratedCodeInfo extends \Google\Protobuf\Internal\Message
{
/**
* <pre>
* An Annotation connects some span of text in generated code to an element
* of its generating .proto file.
* </pre>
*
* <code>repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;</code>
*/
private $annotation;
private $has_annotation = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <pre>
* An Annotation connects some span of text in generated code to an element
* of its generating .proto file.
* </pre>
*
* <code>repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;</code>
*/
public function getAnnotation()
{
return $this->annotation;
}
/**
* <pre>
* An Annotation connects some span of text in generated code to an element
* of its generating .proto file.
* </pre>
*
* <code>repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;</code>
*/
public function setAnnotation(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\GeneratedCodeInfo_Annotation::class);
$this->annotation = $var;
$this->has_annotation = true;
}
public function hasAnnotation()
{
return $this->has_annotation;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* Protobuf type <code>google.protobuf.GeneratedCodeInfo.Annotation</code>
*/
class GeneratedCodeInfo_Annotation extends \Google\Protobuf\Internal\Message
{
/**
* <pre>
* Identifies the element in the original source .proto file. This field
* is formatted the same as SourceCodeInfo.Location.path.
* </pre>
*
* <code>repeated int32 path = 1 [packed = true];</code>
*/
private $path;
private $has_path = false;
/**
* <pre>
* Identifies the filesystem path to the original source .proto.
* </pre>
*
* <code>optional string source_file = 2;</code>
*/
private $source_file = '';
private $has_source_file = false;
/**
* <pre>
* Identifies the starting offset in bytes in the generated code
* that relates to the identified object.
* </pre>
*
* <code>optional int32 begin = 3;</code>
*/
private $begin = 0;
private $has_begin = false;
/**
* <pre>
* Identifies the ending offset in bytes in the generated code that
* relates to the identified offset. The end offset should be one past
* the last relevant byte (so the length of the text = end - begin).
* </pre>
*
* <code>optional int32 end = 4;</code>
*/
private $end = 0;
private $has_end = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <pre>
* Identifies the element in the original source .proto file. This field
* is formatted the same as SourceCodeInfo.Location.path.
* </pre>
*
* <code>repeated int32 path = 1 [packed = true];</code>
*/
public function getPath()
{
return $this->path;
}
/**
* <pre>
* Identifies the element in the original source .proto file. This field
* is formatted the same as SourceCodeInfo.Location.path.
* </pre>
*
* <code>repeated int32 path = 1 [packed = true];</code>
*/
public function setPath(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
$this->path = $var;
$this->has_path = true;
}
public function hasPath()
{
return $this->has_path;
}
/**
* <pre>
* Identifies the filesystem path to the original source .proto.
* </pre>
*
* <code>optional string source_file = 2;</code>
*/
public function getSourceFile()
{
return $this->source_file;
}
/**
* <pre>
* Identifies the filesystem path to the original source .proto.
* </pre>
*
* <code>optional string source_file = 2;</code>
*/
public function setSourceFile($var)
{
GPBUtil::checkString($var, True);
$this->source_file = $var;
$this->has_source_file = true;
}
public function hasSourceFile()
{
return $this->has_source_file;
}
/**
* <pre>
* Identifies the starting offset in bytes in the generated code
* that relates to the identified object.
* </pre>
*
* <code>optional int32 begin = 3;</code>
*/
public function getBegin()
{
return $this->begin;
}
/**
* <pre>
* Identifies the starting offset in bytes in the generated code
* that relates to the identified object.
* </pre>
*
* <code>optional int32 begin = 3;</code>
*/
public function setBegin($var)
{
GPBUtil::checkInt32($var);
$this->begin = $var;
$this->has_begin = true;
}
public function hasBegin()
{
return $this->has_begin;
}
/**
* <pre>
* Identifies the ending offset in bytes in the generated code that
* relates to the identified offset. The end offset should be one past
* the last relevant byte (so the length of the text = end - begin).
* </pre>
*
* <code>optional int32 end = 4;</code>
*/
public function getEnd()
{
return $this->end;
}
/**
* <pre>
* Identifies the ending offset in bytes in the generated code that
* relates to the identified offset. The end offset should be one past
* the last relevant byte (so the length of the text = end - begin).
* </pre>
*
* <code>optional int32 end = 4;</code>
*/
public function setEnd($var)
{
GPBUtil::checkInt32($var);
$this->end = $var;
$this->has_end = true;
}
public function hasEnd()
{
return $this->has_end;
}
}
This diff is collapsed.
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* <pre>
* Describes a method of a service.
* </pre>
*
* Protobuf type <code>google.protobuf.MethodDescriptorProto</code>
*/
class MethodDescriptorProto extends \Google\Protobuf\Internal\Message
{
/**
* <code>optional string name = 1;</code>
*/
private $name = '';
private $has_name = false;
/**
* <pre>
* Input and output type names. These are resolved in the same way as
* FieldDescriptorProto.type_name, but must refer to a message type.
* </pre>
*
* <code>optional string input_type = 2;</code>
*/
private $input_type = '';
private $has_input_type = false;
/**
* <code>optional string output_type = 3;</code>
*/
private $output_type = '';
private $has_output_type = false;
/**
* <code>optional .google.protobuf.MethodOptions options = 4;</code>
*/
private $options = null;
private $has_options = false;
/**
* <pre>
* Identifies if client streams multiple client messages
* </pre>
*
* <code>optional bool client_streaming = 5 [default = false];</code>
*/
private $client_streaming = false;
private $has_client_streaming = false;
/**
* <pre>
* Identifies if server streams multiple server messages
* </pre>
*
* <code>optional bool server_streaming = 6 [default = false];</code>
*/
private $server_streaming = false;
private $has_server_streaming = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <code>optional string name = 1;</code>
*/
public function getName()
{
return $this->name;
}
/**
* <code>optional string name = 1;</code>
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
$this->has_name = true;
}
public function hasName()
{
return $this->has_name;
}
/**
* <pre>
* Input and output type names. These are resolved in the same way as
* FieldDescriptorProto.type_name, but must refer to a message type.
* </pre>
*
* <code>optional string input_type = 2;</code>
*/
public function getInputType()
{
return $this->input_type;
}
/**
* <pre>
* Input and output type names. These are resolved in the same way as
* FieldDescriptorProto.type_name, but must refer to a message type.
* </pre>
*
* <code>optional string input_type = 2;</code>
*/
public function setInputType($var)
{
GPBUtil::checkString($var, True);
$this->input_type = $var;
$this->has_input_type = true;
}
public function hasInputType()
{
return $this->has_input_type;
}
/**
* <code>optional string output_type = 3;</code>
*/
public function getOutputType()
{
return $this->output_type;
}
/**
* <code>optional string output_type = 3;</code>
*/
public function setOutputType($var)
{
GPBUtil::checkString($var, True);
$this->output_type = $var;
$this->has_output_type = true;
}
public function hasOutputType()
{
return $this->has_output_type;
}
/**
* <code>optional .google.protobuf.MethodOptions options = 4;</code>
*/
public function getOptions()
{
return $this->options;
}
/**
* <code>optional .google.protobuf.MethodOptions options = 4;</code>
*/
public function setOptions(&$var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MethodOptions::class);
$this->options = $var;
$this->has_options = true;
}
public function hasOptions()
{
return $this->has_options;
}
/**
* <pre>
* Identifies if client streams multiple client messages
* </pre>
*
* <code>optional bool client_streaming = 5 [default = false];</code>
*/
public function getClientStreaming()
{
return $this->client_streaming;
}
/**
* <pre>
* Identifies if client streams multiple client messages
* </pre>
*
* <code>optional bool client_streaming = 5 [default = false];</code>
*/
public function setClientStreaming($var)
{
GPBUtil::checkBool($var);
$this->client_streaming = $var;
$this->has_client_streaming = true;
}
public function hasClientStreaming()
{
return $this->has_client_streaming;
}
/**
* <pre>
* Identifies if server streams multiple server messages
* </pre>
*
* <code>optional bool server_streaming = 6 [default = false];</code>
*/
public function getServerStreaming()
{
return $this->server_streaming;
}
/**
* <pre>
* Identifies if server streams multiple server messages
* </pre>
*
* <code>optional bool server_streaming = 6 [default = false];</code>
*/
public function setServerStreaming($var)
{
GPBUtil::checkBool($var);
$this->server_streaming = $var;
$this->has_server_streaming = true;
}
public function hasServerStreaming()
{
return $this->has_server_streaming;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
namespace Google\Protobuf\Internal;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
/**
* Protobuf type <code>google.protobuf.MethodOptions</code>
*/
class MethodOptions extends \Google\Protobuf\Internal\Message
{
/**
* <pre>
* Is this method deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the method, or it will be completely ignored; in the very least,
* this is a formalization for deprecating methods.
* </pre>
*
* <code>optional bool deprecated = 33 [default = false];</code>
*/
private $deprecated = false;
private $has_deprecated = false;
/**
* <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
*/
private $idempotency_level = 0;
private $has_idempotency_level = false;
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
private $uninterpreted_option;
private $has_uninterpreted_option = false;
public function __construct() {
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
parent::__construct();
}
/**
* <pre>
* Is this method deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the method, or it will be completely ignored; in the very least,
* this is a formalization for deprecating methods.
* </pre>
*
* <code>optional bool deprecated = 33 [default = false];</code>
*/
public function getDeprecated()
{
return $this->deprecated;
}
/**
* <pre>
* Is this method deprecated?
* Depending on the target platform, this can emit Deprecated annotations
* for the method, or it will be completely ignored; in the very least,
* this is a formalization for deprecating methods.
* </pre>
*
* <code>optional bool deprecated = 33 [default = false];</code>
*/
public function setDeprecated($var)
{
GPBUtil::checkBool($var);
$this->deprecated = $var;
$this->has_deprecated = true;
}
public function hasDeprecated()
{
return $this->has_deprecated;
}
/**
* <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
*/
public function getIdempotencyLevel()
{
return $this->idempotency_level;
}
/**
* <code>optional .google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];</code>
*/
public function setIdempotencyLevel($var)
{
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\MethodOptions_IdempotencyLevel::class);
$this->idempotency_level = $var;
$this->has_idempotency_level = true;
}
public function hasIdempotencyLevel()
{
return $this->has_idempotency_level;
}
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
public function getUninterpretedOption()
{
return $this->uninterpreted_option;
}
/**
* <pre>
* The parser stores options it doesn't recognize here. See above.
* </pre>
*
* <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
*/
public function setUninterpretedOption(&$var)
{
GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
$this->uninterpreted_option = $var;
$this->has_uninterpreted_option = true;
}
public function hasUninterpretedOption()
{
return $this->has_uninterpreted_option;
}
}
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/descriptor.proto
/**
* <pre>
* Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
* or neither? HTTP based RPC implementation may choose GET verb for safe
* methods, and PUT verb for idempotent methods instead of the default POST.
* </pre>
*
* Protobuf enum <code>google.protobuf.MethodOptions.IdempotencyLevel</code>
*/
namespace Google\Protobuf\Internal;
class MethodOptions_IdempotencyLevel
{
/**
* <code>IDEMPOTENCY_UNKNOWN = 0;</code>
*/
const IDEMPOTENCY_UNKNOWN = 0;
/**
* <pre>
* implies idempotent
* </pre>
*
* <code>NO_SIDE_EFFECTS = 1;</code>
*/
const NO_SIDE_EFFECTS = 1;
/**
* <pre>
* idempotent, but may have side effects
* </pre>
*
* <code>IDEMPOTENT = 2;</code>
*/
const IDEMPOTENT = 2;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
require_once('test.pb.php');
require_once('test_util.php');
use Google\Protobuf\Internal\RepeatedField;
......
This diff is collapsed.
<?php
require_once('test.pb.php');
require_once('test_base.php');
require_once('test_util.php');
......
This diff is collapsed.
<?php
require_once('test.pb.php');
require_once('test_no_namespace.pb.php');
require_once('generated/NoNameSpace.php');
require_once('test_util.php');
use Google\Protobuf\Internal\RepeatedField;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment