Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"guzzlehttp/promises": "^2.0",
"guzzlehttp/psr7": "^2.0",
"google/common-protos": "^4.4",
"google/longrunning": "~0.4",
"google/longrunning": "~0.4||^1.0",
"ramsey/uuid": "^4.0"
},
"require-dev": {
Expand Down
2 changes: 2 additions & 0 deletions dev/src/Docs/doctum-protobuf-config.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2022 Google LLC
* All rights reserved.
Expand Down
4 changes: 3 additions & 1 deletion src/AgentHeader.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2016 Google LLC
* All rights reserved.
Expand Down Expand Up @@ -124,7 +126,7 @@ public static function readGapicVersionFromFile(string $callingClass)
$versionFile = substr(
$callingClassFile,
0,
strrpos($callingClassFile, DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR)
strrpos($callingClassFile, DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR) ?: 0
) . DIRECTORY_SEPARATOR . 'VERSION';

return Version::readVersionFile($versionFile);
Expand Down
10 changes: 4 additions & 6 deletions src/ServiceAddressTrait.php → src/ApiEndpointTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down Expand Up @@ -34,12 +36,8 @@

/**
* Provides helper methods for service address handling.
*
* @deprecated
* @todo (dwsupplee) serviceAddress is deprecated now in favor of
* apiEndpoint. Rename the trait/method in our next major release.
*/
trait ServiceAddressTrait
trait ApiEndpointTrait
{
private static $defaultPort = 443;

Expand All @@ -48,7 +46,7 @@ trait ServiceAddressTrait
* @return array
* @throws ValidationException
*/
private static function normalizeServiceAddress(string $apiEndpoint)
private static function normalizeApiEndpoint(string $apiEndpoint)
{
$components = explode(':', $apiEndpoint);
if (count($components) == 2) {
Expand Down
2 changes: 2 additions & 0 deletions src/ApiException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2016 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/ApiKeyHeaderCredentials.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2024 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/ApiStatus.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2017 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/ArrayTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/BidiStream.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2016 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Call.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/ClientOptionsTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2024 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/ClientStream.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2016 Google LLC
* All rights reserved.
Expand Down
20 changes: 2 additions & 18 deletions src/CredentialsWrapper.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down Expand Up @@ -214,24 +216,6 @@ public function getProjectId(?callable $httpHandler = null): ?string
return null;
}

/**
* @deprecated
* @return string Bearer string containing access token.
*/
public function getBearerString()
{
$token = $this->credentialsFetcher->getLastReceivedToken();
if (self::isExpired($token)) {
$this->checkUniverseDomain();

$token = $this->credentialsFetcher->fetchAuthToken($this->authHttpHandler);
if (!self::isValid($token)) {
return '';
}
}
return empty($token['access_token']) ? '' : 'Bearer ' . $token['access_token'];
}

/**
* @param string $audience optional audience for self-signed JWTs.
* @return callable Callable function that returns an authorization header.
Expand Down
2 changes: 2 additions & 0 deletions src/FixedSizeCollection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2016 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/GPBLabel.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2017 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/GPBType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2017 Google LLC
* All rights reserved.
Expand Down
4 changes: 3 additions & 1 deletion src/GapicClientTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down Expand Up @@ -32,7 +34,6 @@

namespace Google\ApiCore;

use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\Middleware\CredentialsWrapperMiddleware;
use Google\ApiCore\Middleware\FixedHeaderMiddleware;
use Google\ApiCore\Middleware\OperationsMiddleware;
Expand All @@ -50,6 +51,7 @@
use Google\ApiCore\Transport\TransportInterface;
use Google\Auth\FetchAuthTokenInterface;
use Google\LongRunning\Operation;
use Google\LongRunning\OperationsClient;
use Google\Protobuf\Internal\Message;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down
2 changes: 2 additions & 0 deletions src/GrpcSupportTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/HeaderCredentialsInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2024 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/InsecureCredentialsWrapper.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2024 Google LLC
* All rights reserved.
Expand Down
1 change: 1 addition & 0 deletions src/InsecureRequestBuilder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace Google\ApiCore;

Expand Down
7 changes: 2 additions & 5 deletions src/KnownTypes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2025 Google LLC
* All rights reserved.
Expand Down Expand Up @@ -38,11 +40,6 @@ class KnownTypes
{
private static bool $initialized = false;

/** @deprecated use BIN_TYPES instead */
public const GRPC_TYPES = self::BIN_TYPES;
/** @deprecated use TYPE_URLS instead */
public const JSON_TYPES = self::TYPE_URLS;

public const BIN_TYPES = [
'google.rpc.retryinfo-bin' => \Google\Rpc\RetryInfo::class,
'google.rpc.debuginfo-bin' => \Google\Rpc\DebugInfo::class,
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/CredentialsWrapperMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/FixedHeaderMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/MiddlewareInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2023 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/OperationsMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/OptionsFilterMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/PagedMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/RequestAutoPopulationMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2024 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/ResponseMetadataMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/RetryMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2018 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Middleware/TransportCallMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2025 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/OperationResponse.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2016 Google LLC
* All rights reserved.
Expand Down
12 changes: 2 additions & 10 deletions src/Options/CallOptions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2023 Google LLC
* All rights reserved.
Expand Down Expand Up @@ -136,16 +138,6 @@ public function setTransportOptions(array $transportOptions): self
return $this;
}

/**
* @deprecated use CallOptions::setTransportOptions
*/
public function setTransportSpecificOptions(array $transportSpecificOptions): self
{
$this->setTransportOptions($transportSpecificOptions);

return $this;
}

/**
* @param RetrySettings|array|null $retrySettings
*
Expand Down
2 changes: 2 additions & 0 deletions src/Options/ClientOptions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2023 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Options/OptionsInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2025 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Options/OptionsTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2023 Google LLC
* All rights reserved.
Expand Down
2 changes: 2 additions & 0 deletions src/Options/TransportOptions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2023 Google LLC
* All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/*
* Copyright 2023 Google LLC
* All rights reserved.
Expand Down
Loading
Loading