I found this in the docs, which I think might be where you are pulling things from:
Which has this example code:
require 'vendor/autoload.php';
use Google\Cloud\SecretManager\V1\Replication;
use Google\Cloud\SecretManager\V1\Replication\Automatic;
use Google\Cloud\SecretManager\V1\Secret;
use Google\Cloud\SecretManager\V1\SecretManagerServiceClient;
$client = new SecretManagerServiceClient();
$secret = $client->createSecret(
SecretManagerServiceClient::projectName('[MY_PROJECT_ID]'),
'[MY_SECRET_ID]',
new Secret([
'replication' => new Replication([
'automatic' => new Automatic()
])
])
);
printf(
'Created secret: %s' . PHP_EOL,
$secret->getName()
);
When I pulled that into my original file of mozart.php
, my lsp server complains about a missing class. When I run find . -name '*SecretManager*'
to see where that file is on disk, it looks like it might be found in a slightly different location than the docs would lead you to think:
When I updated the use
statement to include `…\Client\SecretManager…', things seem to be resolving correctly.
Can you take a closer look and let me know what you find?