Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [Many APIs] Add compatibility for PHP 8.4 #7910

Merged
merged 4 commits into from
Dec 11, 2024
Merged
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
10 changes: 7 additions & 3 deletions Billing/src/V1/Client/CloudBillingClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: Retrieves the Google Cloud Console billing accounts and associates them with
Expand Down Expand Up @@ -217,14 +218,14 @@ public static function projectBillingInfoName(string $project): string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -279,6 +280,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
10 changes: 7 additions & 3 deletions Billing/src/V1/Client/CloudCatalogClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use Google\Cloud\Billing\V1\ListServicesRequest;
use Google\Cloud\Billing\V1\ListSkusRequest;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: A catalog of Google Cloud Platform services and SKUs.
Expand Down Expand Up @@ -130,14 +131,14 @@ public static function serviceName(string $service): string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -192,6 +193,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
10 changes: 7 additions & 3 deletions BillingBudgets/src/V1/Client/BudgetServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
use Google\Cloud\Billing\Budgets\V1\ListBudgetsRequest;
use Google\Cloud\Billing\Budgets\V1\UpdateBudgetRequest;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: BudgetService stores Cloud Billing budgets, which define a
Expand Down Expand Up @@ -153,14 +154,14 @@ public static function budgetName(string $billingAccount, string $budget): strin
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -215,6 +216,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
use Google\Cloud\BinaryAuthorization\V1\UpdateAttestorRequest;
use Google\Cloud\BinaryAuthorization\V1\UpdatePolicyRequest;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: Google Cloud Management Service for Binary Authorization admission policies
Expand Down Expand Up @@ -209,14 +210,14 @@ public static function projectPolicyName(string $project): string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -271,6 +272,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
10 changes: 7 additions & 3 deletions BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Google\Cloud\BinaryAuthorization\V1\GetSystemPolicyRequest;
use Google\Cloud\BinaryAuthorization\V1\Policy;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: API for working with the system policy.
Expand Down Expand Up @@ -154,14 +155,14 @@ public static function projectPolicyName(string $project): string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -216,6 +217,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use Google\Cloud\BinaryAuthorization\V1\ValidateAttestationOccurrenceRequest;
use Google\Cloud\BinaryAuthorization\V1\ValidateAttestationOccurrenceResponse;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: BinAuthz Attestor verification
Expand Down Expand Up @@ -138,6 +139,9 @@ private static function getClientDefaults()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
10 changes: 7 additions & 3 deletions Build/src/V2/Client/RepositoryManagerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: Manages connections to source code repositories.
Expand Down Expand Up @@ -306,14 +307,14 @@ public static function serviceName(string $project, string $location, string $na
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -368,6 +369,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
10 changes: 7 additions & 3 deletions CertificateManager/src/V1/Client/CertificateManagerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: API Overview
Expand Down Expand Up @@ -420,14 +421,14 @@ public static function trustConfigName(string $project, string $location, string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -482,6 +483,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
10 changes: 7 additions & 3 deletions Channel/src/V1/Client/CloudChannelReportsServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: CloudChannelReportsService lets Google Cloud resellers and
Expand Down Expand Up @@ -213,14 +214,14 @@ public static function reportJobName(string $account, string $reportJob): string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -275,6 +276,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
10 changes: 7 additions & 3 deletions Channel/src/V1/Client/CloudChannelServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: CloudChannelService lets Google cloud resellers and distributors manage
Expand Down Expand Up @@ -442,14 +443,14 @@ public static function skuGroupName(string $account, string $skuGroup): string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -504,6 +505,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: ConsumerProcurementService allows customers to make purchases of products
Expand Down Expand Up @@ -250,14 +251,14 @@ public static function serviceOfferName(string $service, string $offer): string
* listed, then parseName will check each of the supported templates, and return
* the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
* @param string $formattedName The formatted name string
* @param ?string $template Optional name of template to match
*
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
*/
public static function parseName(string $formattedName, string $template = null): array
public static function parseName(string $formattedName, ?string $template = null): array
{
return self::parseFormattedName($formattedName, $template);
}
Expand Down Expand Up @@ -313,6 +314,9 @@ public static function parseName(string $formattedName, string $template = null)
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
Loading
Loading