Skip to content

Commit

Permalink
add conditional for BC
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Dec 11, 2024
1 parent e869f85 commit b46b925
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/src/ServiceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Google\Cloud\PubSub\PubSubClient;
use Google\Cloud\Spanner\SpannerClient;
use Google\Cloud\Speech\V2\Client\SpeechClient;
use Google\Cloud\Speech\SpeechClient as DeprecatedSpeechClient;
use Google\Cloud\Storage\StorageClient;
use Google\Cloud\Trace\TraceClient;
use Google\Cloud\Translate\V2\TranslateClient;
Expand Down Expand Up @@ -274,6 +275,9 @@ public function spanner(array $config = [])
*/
public function speech(array $config = [])
{
if (class_exists(DeprecatedSpeechClient::class)) {
return $this->createClient(DeprecatedSpeechClient::class, 'speech', $config);
}
throw new \BadMethodCallException(sprintf(

Check failure on line 281 in Core/src/ServiceBuilder.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Call to sprintf contains 1 placeholder, 0 values given.
'This method is no longer supported, create %s directly instead.'.
SpeechClient::class
Expand Down

0 comments on commit b46b925

Please sign in to comment.