Skip to content

Commit

Permalink
Showing 6 changed files with 154 additions and 148 deletions.
106 changes: 54 additions & 52 deletions src/php/tests/generated_code/math.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?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 {

class DivArgs extends \DrSlump\Protobuf\Message {

/** @var int */
public $dividend = null;

/** @var int */
public $divisor = null;


/** @var \Closure[] */
protected static $__extensions = array();
@@ -21,20 +21,20 @@ public static function descriptor()
{
$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) {
@@ -52,7 +52,7 @@ public static function descriptor()
public function hasDividend(){
return $this->_has(1);
}

/**
* Clear <dividend> value
*
@@ -61,7 +61,7 @@ public function hasDividend(){
public function clearDividend(){
return $this->_clear(1);
}

/**
* Get <dividend> value
*
@@ -70,7 +70,7 @@ public function clearDividend(){
public function getDividend(){
return $this->_get(1);
}

/**
* Set <dividend> value
*
@@ -80,7 +80,7 @@ public function getDividend(){
public function setDividend( $value){
return $this->_set(1, $value);
}

/**
* Check if <divisor> has a value
*
@@ -89,7 +89,7 @@ public function setDividend( $value){
public function hasDivisor(){
return $this->_has(2);
}

/**
* Clear <divisor> value
*
@@ -98,7 +98,7 @@ public function hasDivisor(){
public function clearDivisor(){
return $this->_clear(2);
}

/**
* Get <divisor> value
*
@@ -107,7 +107,7 @@ public function clearDivisor(){
public function getDivisor(){
return $this->_get(2);
}

/**
* Set <divisor> value
*
@@ -126,10 +126,10 @@ class DivReply extends \DrSlump\Protobuf\Message {

/** @var int */
public $quotient = null;

/** @var int */
public $remainder = null;


/** @var \Closure[] */
protected static $__extensions = array();
@@ -138,20 +138,20 @@ public static function descriptor()
{
$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) {
@@ -169,7 +169,7 @@ public static function descriptor()
public function hasQuotient(){
return $this->_has(1);
}

/**
* Clear <quotient> value
*
@@ -178,7 +178,7 @@ public function hasQuotient(){
public function clearQuotient(){
return $this->_clear(1);
}

/**
* Get <quotient> value
*
@@ -187,7 +187,7 @@ public function clearQuotient(){
public function getQuotient(){
return $this->_get(1);
}

/**
* Set <quotient> value
*
@@ -197,7 +197,7 @@ public function getQuotient(){
public function setQuotient( $value){
return $this->_set(1, $value);
}

/**
* Check if <remainder> has a value
*
@@ -206,7 +206,7 @@ public function setQuotient( $value){
public function hasRemainder(){
return $this->_has(2);
}

/**
* Clear <remainder> value
*
@@ -215,7 +215,7 @@ public function hasRemainder(){
public function clearRemainder(){
return $this->_clear(2);
}

/**
* Get <remainder> value
*
@@ -224,7 +224,7 @@ public function clearRemainder(){
public function getRemainder(){
return $this->_get(2);
}

/**
* Set <remainder> value
*
@@ -243,7 +243,7 @@ class FibArgs extends \DrSlump\Protobuf\Message {

/** @var int */
public $limit = null;


/** @var \Closure[] */
protected static $__extensions = array();
@@ -275,7 +275,7 @@ public static function descriptor()
public function hasLimit(){
return $this->_has(1);
}

/**
* Clear <limit> value
*
@@ -284,7 +284,7 @@ public function hasLimit(){
public function clearLimit(){
return $this->_clear(1);
}

/**
* Get <limit> value
*
@@ -293,7 +293,7 @@ public function clearLimit(){
public function getLimit(){
return $this->_get(1);
}

/**
* Set <limit> value
*
@@ -312,7 +312,7 @@ class Num extends \DrSlump\Protobuf\Message {

/** @var int */
public $num = null;


/** @var \Closure[] */
protected static $__extensions = array();
@@ -321,12 +321,12 @@ public static function descriptor()
{
$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) {
@@ -344,7 +344,7 @@ public static function descriptor()
public function hasNum(){
return $this->_has(1);
}

/**
* Clear <num> value
*
@@ -353,7 +353,7 @@ public function hasNum(){
public function clearNum(){
return $this->_clear(1);
}

/**
* Get <num> value
*
@@ -362,7 +362,7 @@ public function clearNum(){
public function getNum(){
return $this->_get(1);
}

/**
* Set <num> value
*
@@ -381,7 +381,7 @@ class FibReply extends \DrSlump\Protobuf\Message {

/** @var int */
public $count = null;


/** @var \Closure[] */
protected static $__extensions = array();
@@ -390,12 +390,12 @@ public static function descriptor()
{
$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) {
@@ -413,7 +413,7 @@ public static function descriptor()
public function hasCount(){
return $this->_has(1);
}

/**
* Clear <count> value
*
@@ -422,7 +422,7 @@ public function hasCount(){
public function clearCount(){
return $this->_clear(1);
}

/**
* Get <count> value
*
@@ -431,7 +431,7 @@ public function clearCount(){
public function getCount(){
return $this->_get(1);
}

/**
* Set <count> value
*
@@ -446,34 +446,36 @@ public function setCount( $value){

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);
}
}
}
Loading
Oops, something went wrong.

0 comments on commit 65dda6c

Please sign in to comment.