Updated generated code to match protos

pull/1162/head
murgatroid99 10 years ago
parent a60dd3b7d5
commit 65dda6ca31
  1. 46
      src/php/tests/generated_code/math.php
  2. 5
      src/php/tests/interop/empty.php
  3. 4
      src/php/tests/interop/empty.proto
  4. 13
      src/php/tests/interop/messages.php
  5. 4
      src/php/tests/interop/test.php
  6. 2
      src/php/tests/interop/test.proto

@ -1,7 +1,7 @@
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0
// Source: math.proto
// Date: 2014-11-14 00:00:41
// Date: 2015-04-01 01:00:50
namespace math {
@ -21,20 +21,20 @@ namespace math {
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.DivArgs');
// REQUIRED INT64 dividend = 1
// OPTIONAL INT64 dividend = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = "dividend";
$f->type = \DrSlump\Protobuf::TYPE_INT64;
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
// REQUIRED INT64 divisor = 2
// OPTIONAL INT64 divisor = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = "divisor";
$f->type = \DrSlump\Protobuf::TYPE_INT64;
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
@ -138,20 +138,20 @@ namespace math {
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.DivReply');
// REQUIRED INT64 quotient = 1
// OPTIONAL INT64 quotient = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = "quotient";
$f->type = \DrSlump\Protobuf::TYPE_INT64;
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
// REQUIRED INT64 remainder = 2
// OPTIONAL INT64 remainder = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = "remainder";
$f->type = \DrSlump\Protobuf::TYPE_INT64;
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
@ -321,12 +321,12 @@ namespace math {
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.Num');
// REQUIRED INT64 num = 1
// OPTIONAL INT64 num = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = "num";
$f->type = \DrSlump\Protobuf::TYPE_INT64;
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
@ -390,12 +390,12 @@ namespace math {
{
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.FibReply');
// REQUIRED INT64 count = 1
// OPTIONAL INT64 count = 1
$f = new \DrSlump\Protobuf\Field();
$f->number = 1;
$f->name = "count";
$f->type = \DrSlump\Protobuf::TYPE_INT64;
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
foreach (self::$__extensions as $cb) {
@ -446,34 +446,36 @@ namespace math {
namespace math {
class MathClient extends \Grpc\BaseStub {
class MathClient{
private $rpc_impl;
public function __construct($rpc_impl) {
$this->rpc_impl = $rpc_impl;
}
/**
* @param math\DivArgs $input
* @return math\DivReply
*/
public function Div(\math\DivArgs $argument, $metadata = array()) {
return $this->_simpleRequest('/Math/Div', $argument, '\math\DivReply::deserialize', $metadata);
return $this->rpc_impl->_simpleRequest('/math.Math/Div', $argument, '\math\DivReply::deserialize', $metadata);
}
/**
* @param math\DivArgs $input
* @return math\DivReply
*/
public function DivMany($metadata = array()) {
return $this->_bidiRequest('/Math/DivMany', '\math\DivReply::deserialize', $metadata);
return $this->rpc_impl->_bidiRequest('/math.Math/DivMany', '\math\DivReply::deserialize', $metadata);
}
/**
* @param math\FibArgs $input
* @return math\Num
*/
public function Fib($argument, $metadata = array()) {
return $this->_serverStreamRequest('/Math/Fib', $argument, '\math\Num::deserialize', $metadata);
return $this->rpc_impl->_serverStreamRequest('/math.Math/Fib', $argument, '\math\Num::deserialize', $metadata);
}
/**
* @param math\Num $input
* @return math\Num
*/
public function Sum($arguments, $metadata = array()) {
return $this->_clientStreamRequest('/Math/Sum', $arguments, '\math\Num::deserialize', $metadata);
return $this->rpc_impl->_clientStreamRequest('/math.Math/Sum', $arguments, '\math\Num::deserialize', $metadata);
}
}
}

@ -1,7 +1,7 @@
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0
// Source: test/cpp/interop/empty.proto
// Date: 2015-01-30 23:30:46
// Source: empty.proto
// Date: 2015-04-01 00:58:16
namespace grpc\testing {
@ -23,3 +23,4 @@ namespace grpc\testing {
}
}
}

@ -37,7 +37,7 @@ package grpc.testing;
// return value of a service API. For instance:
//
// service Foo {
// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
// rpc Bar (grpc.testing.EmptyMessage) returns (grpc.testing.EmptyMessage) { };
// };
//
message Empty {}
message EmptyMessage {}

@ -1,7 +1,7 @@
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0
// Source: test/cpp/interop/messages.proto
// Date: 2015-01-30 23:30:46
// Source: messages.proto
// Date: 2015-04-01 00:58:16
namespace grpc\testing {
@ -16,7 +16,7 @@ namespace grpc\testing {
class Payload extends \DrSlump\Protobuf\Message {
/** @var int - \grpc\testing\PayloadType */
public $type = null;
public $type = \grpc\testing\PayloadType::COMPRESSABLE;
/** @var string */
public $body = null;
@ -36,6 +36,7 @@ namespace grpc\testing {
$f->type = \DrSlump\Protobuf::TYPE_ENUM;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->reference = '\grpc\testing\PayloadType';
$f->default = \grpc\testing\PayloadType::COMPRESSABLE;
$descriptor->addField($f);
// OPTIONAL BYTES body = 2
@ -134,7 +135,7 @@ namespace grpc\testing {
class SimpleRequest extends \DrSlump\Protobuf\Message {
/** @var int - \grpc\testing\PayloadType */
public $response_type = null;
public $response_type = \grpc\testing\PayloadType::COMPRESSABLE;
/** @var int */
public $response_size = null;
@ -163,6 +164,7 @@ namespace grpc\testing {
$f->type = \DrSlump\Protobuf::TYPE_ENUM;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->reference = '\grpc\testing\PayloadType';
$f->default = \grpc\testing\PayloadType::COMPRESSABLE;
$descriptor->addField($f);
// OPTIONAL INT32 response_size = 2
@ -819,7 +821,7 @@ namespace grpc\testing {
class StreamingOutputCallRequest extends \DrSlump\Protobuf\Message {
/** @var int - \grpc\testing\PayloadType */
public $response_type = null;
public $response_type = \grpc\testing\PayloadType::COMPRESSABLE;
/** @var \grpc\testing\ResponseParameters[] */
public $response_parameters = array();
@ -842,6 +844,7 @@ namespace grpc\testing {
$f->type = \DrSlump\Protobuf::TYPE_ENUM;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->reference = '\grpc\testing\PayloadType';
$f->default = \grpc\testing\PayloadType::COMPRESSABLE;
$descriptor->addField($f);
// REPEATED MESSAGE response_parameters = 2

@ -1,7 +1,7 @@
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0
// Source: test/cpp/interop/test.proto
// Date: 2015-01-30 23:30:46
// Source: test.proto
// Date: 2015-04-01 00:58:16
namespace grpc\testing {

@ -41,7 +41,7 @@ package grpc.testing;
// performance with various types of payload.
service TestService {
// One empty request followed by one empty response.
rpc EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty);
rpc EmptyCall(grpc.testing.EmptyMessage) returns (grpc.testing.EmptyMessage);
// One request followed by one response.
// TODO(Issue 527): Describe required server behavior.

Loading…
Cancel
Save