aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/lib/Grpc/BaseStub.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php/lib/Grpc/BaseStub.php')
-rwxr-xr-xsrc/php/lib/Grpc/BaseStub.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php
index 0a3e1f78bf..5614314598 100755
--- a/src/php/lib/Grpc/BaseStub.php
+++ b/src/php/lib/Grpc/BaseStub.php
@@ -114,7 +114,9 @@ class BaseStub {
return true;
}
if ($new_state == \Grpc\CHANNEL_FATAL_FAILURE) {
+ // @codeCoverageIgnoreStart
throw new \Exception('Failed to connect to server');
+ // @codeCoverageIgnoreEnd
}
return false;
}
@@ -123,7 +125,7 @@ class BaseStub {
* Close the communication channel associated with this stub
*/
public function close() {
- $channel->close();
+ $this->channel->close();
}
/**
@@ -132,7 +134,7 @@ class BaseStub {
private function _get_jwt_aud_uri($method) {
$last_slash_idx = strrpos($method, '/');
if ($last_slash_idx === false) {
- return false;
+ throw new \InvalidArgumentException('service name must have a slash');
}
$service_name = substr($method, 0, $last_slash_idx);
return "https://" . $this->hostname . $service_name;