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

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

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

Loading…
Cancel
Save