google-cloud-php
google-cloud-php copied to clipboard
DEPRECATED warnings when calling getName() on a Secret or SecretVersion
Environment details
- OS: MacOS Sonoma 14.5 (M1 series)
- PHP version: 8.2.21
- Package name and version: cloud-secret-manager: v1.15.2
Steps to reproduce
Call the getName()
method of either a Secret or a SecretVersion.
Code example
$projectId = 'beetlejuice-example';
$client = new SecretManagerServiceClient();
$parent = $client->projectName($projectId);
$secretId = 'harry-belafonte-example';
$createSecretRequest = (new CreateSecretRequest())
->setParent($parent)
->setSecretId($secretId)
->setSecret(new Secret([
'replication' => new Replication([
'automatic' => new Automatic(),
]),
]));
$secret = $this->client->createSecret($createSecretRequest);
echo $secret->getName();
The above code outputs many copies of the following pair of deprecation warnings:
DEPRECATED strlen(): Passing null to parameter #1 ($string) of type string is deprecated in vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php on line 1890.
DEPRECATED strlen(): Passing null to parameter #1 ($string) of type string is deprecated in vendor/google/protobuf/src/Google/Protobuf/Internal/GPBJsonWire.php on line 23.