Merge pull request #25019 from HannahShiSFB/phpunit8-warnings

PHP: fix phpunit 8 warnings
pull/25161/head
Stanley Cheung 4 years ago committed by GitHub
commit 8dfb66b53e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      src/php/lib/Grpc/BaseStub.php
  2. 16
      src/php/lib/Grpc/Interceptor.php
  3. 32
      src/php/tests/unit_tests/InterceptorTest.php

@ -423,9 +423,9 @@ class BaseStub
$method, $method,
$argument, $argument,
$deserialize, $deserialize,
$this->_UnaryUnaryCallFactory($channel->getNext()),
$metadata, $metadata,
$options, $options
$this->_UnaryUnaryCallFactory($channel->getNext())
); );
}; };
} }
@ -452,9 +452,9 @@ class BaseStub
$method, $method,
$argument, $argument,
$deserialize, $deserialize,
$this->_UnaryStreamCallFactory($channel->getNext()),
$metadata, $metadata,
$options, $options
$this->_UnaryStreamCallFactory($channel->getNext())
); );
}; };
} }
@ -479,9 +479,9 @@ class BaseStub
return $channel->getInterceptor()->interceptStreamUnary( return $channel->getInterceptor()->interceptStreamUnary(
$method, $method,
$deserialize, $deserialize,
$this->_StreamUnaryCallFactory($channel->getNext()),
$metadata, $metadata,
$options, $options
$this->_StreamUnaryCallFactory($channel->getNext())
); );
}; };
} }
@ -506,9 +506,9 @@ class BaseStub
return $channel->getInterceptor()->interceptStreamStream( return $channel->getInterceptor()->interceptStreamStream(
$method, $method,
$deserialize, $deserialize,
$this->_StreamStreamCallFactory($channel->getNext()),
$metadata, $metadata,
$options, $options
$this->_StreamStreamCallFactory($channel->getNext())
); );
}; };
} }

@ -31,9 +31,9 @@ class Interceptor
$method, $method,
$argument, $argument,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = []
$continuation
) { ) {
return $continuation($method, $argument, $deserialize, $metadata, $options); return $continuation($method, $argument, $deserialize, $metadata, $options);
} }
@ -41,9 +41,9 @@ class Interceptor
public function interceptStreamUnary( public function interceptStreamUnary(
$method, $method,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = []
$continuation
) { ) {
return $continuation($method, $deserialize, $metadata, $options); return $continuation($method, $deserialize, $metadata, $options);
} }
@ -52,9 +52,9 @@ class Interceptor
$method, $method,
$argument, $argument,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = []
$continuation
) { ) {
return $continuation($method, $argument, $deserialize, $metadata, $options); return $continuation($method, $argument, $deserialize, $metadata, $options);
} }
@ -62,9 +62,9 @@ class Interceptor
public function interceptStreamStream( public function interceptStreamStream(
$method, $method,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = []
$continuation
) { ) {
return $continuation($method, $deserialize, $metadata, $options); return $continuation($method, $deserialize, $metadata, $options);
} }

@ -96,18 +96,18 @@ class ChangeMetadataInterceptor extends Grpc\Interceptor
public function interceptUnaryUnary($method, public function interceptUnaryUnary($method,
$argument, $argument,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
$metadata["foo"] = array('interceptor_from_unary_request'); $metadata["foo"] = array('interceptor_from_unary_request');
return $continuation($method, $argument, $deserialize, $metadata, $options); return $continuation($method, $argument, $deserialize, $metadata, $options);
} }
public function interceptStreamUnary($method, public function interceptStreamUnary($method,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
$metadata["foo"] = array('interceptor_from_stream_request'); $metadata["foo"] = array('interceptor_from_stream_request');
return $continuation($method, $deserialize, $metadata, $options); return $continuation($method, $deserialize, $metadata, $options);
@ -119,9 +119,9 @@ class ChangeMetadataInterceptor2 extends Grpc\Interceptor
public function interceptUnaryUnary($method, public function interceptUnaryUnary($method,
$argument, $argument,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
if (array_key_exists('foo', $metadata)) { if (array_key_exists('foo', $metadata)) {
$metadata['bar'] = array('ChangeMetadataInterceptor should be executed first'); $metadata['bar'] = array('ChangeMetadataInterceptor should be executed first');
@ -132,9 +132,9 @@ class ChangeMetadataInterceptor2 extends Grpc\Interceptor
} }
public function interceptStreamUnary($method, public function interceptStreamUnary($method,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
if (array_key_exists('foo', $metadata)) { if (array_key_exists('foo', $metadata)) {
$metadata['bar'] = array('ChangeMetadataInterceptor should be executed first'); $metadata['bar'] = array('ChangeMetadataInterceptor should be executed first');
@ -175,18 +175,18 @@ class ChangeRequestInterceptor extends Grpc\Interceptor
public function interceptUnaryUnary($method, public function interceptUnaryUnary($method,
$argument, $argument,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
$argument->setData('intercepted_unary_request'); $argument->setData('intercepted_unary_request');
return $continuation($method, $argument, $deserialize, $metadata, $options); return $continuation($method, $argument, $deserialize, $metadata, $options);
} }
public function interceptStreamUnary($method, public function interceptStreamUnary($method,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
return new ChangeRequestCall( return new ChangeRequestCall(
$continuation($method, $deserialize, $metadata, $options) $continuation($method, $deserialize, $metadata, $options)
@ -199,17 +199,17 @@ class StopCallInterceptor extends Grpc\Interceptor
public function interceptUnaryUnary($method, public function interceptUnaryUnary($method,
$argument, $argument,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
$metadata["foo"] = array('interceptor_from_request_response'); $metadata["foo"] = array('interceptor_from_request_response');
} }
public function interceptStreamUnary($method, public function interceptStreamUnary($method,
$deserialize, $deserialize,
$continuation,
array $metadata = [], array $metadata = [],
array $options = [], array $options = [])
$continuation)
{ {
$metadata["foo"] = array('interceptor_from_request_response'); $metadata["foo"] = array('interceptor_from_request_response');
} }

Loading…
Cancel
Save