From 9e745f771b2a0cde271b8283753c19014124ac95 Mon Sep 17 00:00:00 2001 From: Matt A Date: Tue, 18 Jul 2017 10:45:18 -0400 Subject: Support PHP generic services (#3269) * Add php_generic_services option * Generate PHP generic services * Respect namespaces for generated PHP services * Test PHP generated services * Rename PHP generator service method doc comment function * Correct phpdoc service method case * Test namespaced PHP generic services * Always use the FQCN for PHP generic service input/output * Add generated_service_test to php test.sh * Add php service test protos to CI * Add php service files to php_EXTRA_DIST * Use Interface suffix for php generic services --- .../Google/Protobuf/Internal/Descriptor.php | 1 + php/src/Google/Protobuf/Internal/FileOptions.php | 33 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'php/src') diff --git a/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php b/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php index 636a0ad4..1e3c745e 100644 --- a/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php +++ b/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php @@ -139,6 +139,7 @@ class Descriptor ->optional('cc_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 16) ->optional('java_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 17) ->optional('py_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 18) + ->optional('php_generic_services', \Google\Protobuf\Internal\GPBType::BOOL, 19) ->optional('deprecated', \Google\Protobuf\Internal\GPBType::BOOL, 23) ->optional('cc_enable_arenas', \Google\Protobuf\Internal\GPBType::BOOL, 31) ->optional('objc_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 36) diff --git a/php/src/Google/Protobuf/Internal/FileOptions.php b/php/src/Google/Protobuf/Internal/FileOptions.php index 200ee9de..c7972ca7 100644 --- a/php/src/Google/Protobuf/Internal/FileOptions.php +++ b/php/src/Google/Protobuf/Internal/FileOptions.php @@ -109,6 +109,11 @@ class FileOptions extends \Google\Protobuf\Internal\Message */ private $py_generic_services = false; private $has_py_generic_services = false; + /** + * Generated from protobuf field optional bool php_generic_services = 19 [default = false]; + */ + private $php_generic_services = false; + private $has_php_generic_services = false; /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -548,6 +553,34 @@ class FileOptions extends \Google\Protobuf\Internal\Message return $this->has_py_generic_services; } + /** + * Generated from protobuf field optional bool php_generic_services = 19 [default = false]; + * @return bool + */ + public function getPhpGenericServices() + { + return $this->php_generic_services; + } + + /** + * Generated from protobuf field optional bool php_generic_services = 19 [default = false]; + * @param bool $var + * @return $this + */ + public function setPhpGenericServices($var) + { + GPBUtil::checkBool($var); + $this->php_generic_services = $var; + $this->has_php_generic_services = true; + + return $this; + } + + public function hasPhpGenericServices() + { + return $this->has_php_generic_services; + } + /** * Is this file deprecated? * Depending on the target platform, this can emit Deprecated annotations -- cgit v1.2.3