diff options
author | Stanislav Pavlovichev <pavlovichev@coccoc.com> | 2016-08-23 23:20:34 +0700 |
---|---|---|
committer | Stanislav Pavlovichev <pavlovichev@coccoc.com> | 2016-08-23 23:20:34 +0700 |
commit | d58199b1d0e0d5d9e8ea55bbef18e175018f618d (patch) | |
tree | 4804865e9c1d845cdda1dff307809355e94d184d /src/php/lib/Grpc/AbstractCall.php | |
parent | 0e43d67602096a5c4aeab4632579bc56cf692553 (diff) |
code style
phpdoc fix
isset to array_key_exists
Diffstat (limited to 'src/php/lib/Grpc/AbstractCall.php')
-rw-r--r-- | src/php/lib/Grpc/AbstractCall.php | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/src/php/lib/Grpc/AbstractCall.php b/src/php/lib/Grpc/AbstractCall.php index c86d298805..c58ee56742 100644 --- a/src/php/lib/Grpc/AbstractCall.php +++ b/src/php/lib/Grpc/AbstractCall.php @@ -34,8 +34,15 @@ namespace Grpc; +/** + * Class AbstractCall + * @package Grpc + */ abstract class AbstractCall { + /** + * @var Call + */ protected $call; protected $deserialize; protected $metadata; @@ -51,13 +58,15 @@ abstract class AbstractCall * the response * @param array $options Call options (optional) */ - public function __construct(Channel $channel, - $method, - $deserialize, - $options = []) - { - if (isset($options['timeout']) && - is_numeric($timeout = $options['timeout'])) { + public function __construct( + Channel $channel, + $method, + $deserialize, + $options = [] + ) { + if (array_key_exists('timeout', $options) && + is_numeric($timeout = $options['timeout']) + ) { $now = Timeval::now(); $delta = new Timeval($timeout); $deadline = $now->add($delta); @@ -68,17 +77,19 @@ abstract class AbstractCall $this->deserialize = $deserialize; $this->metadata = null; $this->trailing_metadata = null; - if (isset($options['call_credentials_callback']) && + if (array_key_exists('call_credentials_callback', $options) && is_callable($call_credentials_callback = - $options['call_credentials_callback'])) { + $options['call_credentials_callback']) + ) { $call_credentials = CallCredentials::createFromPlugin( - $call_credentials_callback); + $call_credentials_callback + ); $this->call->setCredentials($call_credentials); } } /** - * @return The metadata sent by the server. + * @return mixed The metadata sent by the server. */ public function getMetadata() { @@ -86,7 +97,7 @@ abstract class AbstractCall } /** - * @return The trailing metadata sent by the server. + * @return mixed The trailing metadata sent by the server. */ public function getTrailingMetadata() { @@ -114,7 +125,7 @@ abstract class AbstractCall * * @param string $value The binary value to deserialize * - * @return The deserialized value + * @return mixed The deserialized value */ protected function deserializeResponse($value) { |