Skip to content

Commit

Permalink
fix: issues in Options classes (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Feb 14, 2024
1 parent 7d2533e commit aa9ba3a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Options/ClientOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private function fromArray(array $arr): void
$this->setTransport($arr['transport'] ?? null);
$this->setTransportConfig(new TransportOptions($arr['transportConfig'] ?? []));
$this->setVersionFile($arr['versionFile'] ?? null);
$this->setDescriptorsConfigPath($arr['descriptorsConfigPath']);
$this->setDescriptorsConfigPath($arr['descriptorsConfigPath'] ?? null);
$this->setServiceName($arr['serviceName'] ?? null);
$this->setLibName($arr['libName'] ?? null);
$this->setLibVersion($arr['libVersion'] ?? null);
Expand Down Expand Up @@ -302,7 +302,7 @@ public function setGapicVersion(?string $gapicVersion): void
public function setClientCertSource(?callable $clientCertSource)
{
if (!is_null($clientCertSource)) {
$this->clientCertSource = Closure::fromCallable($clientCertSource);
$clientCertSource = Closure::fromCallable($clientCertSource);
}
$this->clientCertSource = $clientCertSource;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Options/TransportOptions/GrpcFallbackTransportOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private function fromArray(array $arr): void
public function setHttpHandler(?callable $httpHandler)
{
if (!is_null($httpHandler)) {
$this->httpHandler = Closure::fromCallable($httpHandler);
$httpHandler = Closure::fromCallable($httpHandler);
}
$this->httpHandler = $httpHandler;
}
Expand All @@ -88,7 +88,7 @@ public function setHttpHandler(?callable $httpHandler)
public function setClientCertSource(?callable $clientCertSource)
{
if (!is_null($clientCertSource)) {
$this->clientCertSource = Closure::fromCallable($clientCertSource);
$clientCertSource = Closure::fromCallable($clientCertSource);
}
$this->clientCertSource = $clientCertSource;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Options/TransportOptions/GrpcTransportOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function setInterceptors(array $interceptors)
public function setClientCertSource(?callable $clientCertSource)
{
if (!is_null($clientCertSource)) {
$this->clientCertSource = Closure::fromCallable($clientCertSource);
$clientCertSource = Closure::fromCallable($clientCertSource);
}
$this->clientCertSource = $clientCertSource;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Options/TransportOptions/RestTransportOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private function fromArray(array $arr): void
public function setHttpHandler(?callable $httpHandler)
{
if (!is_null($httpHandler)) {
$this->httpHandler = Closure::fromCallable($httpHandler);
$httpHandler = Closure::fromCallable($httpHandler);
}
$this->httpHandler = $httpHandler;
}
Expand All @@ -96,7 +96,7 @@ public function setHttpHandler(?callable $httpHandler)
public function setClientCertSource(?callable $clientCertSource)
{
if (!is_null($clientCertSource)) {
$this->clientCertSource = Closure::fromCallable($clientCertSource);
$clientCertSource = Closure::fromCallable($clientCertSource);
}
$this->clientCertSource = $clientCertSource;
}
Expand Down

0 comments on commit aa9ba3a

Please sign in to comment.