Skip to content
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
2 changes: 1 addition & 1 deletion compute/instances/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"google/cloud-compute": "^1.14",
"google/cloud-compute": "^2.0",
"google/cloud-storage": "^1.36"
}
}
4 changes: 2 additions & 2 deletions compute/instances/src/create_instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

# [START compute_instances_create]
use Google\Cloud\Compute\V1\AttachedDisk;
use Google\Cloud\Compute\V1\AttachedDisk\Type;
use Google\Cloud\Compute\V1\AttachedDiskInitializeParams;
use Google\Cloud\Compute\V1\Client\InstancesClient;
use Google\Cloud\Compute\V1\Enums\AttachedDisk\Type;
use Google\Cloud\Compute\V1\InsertInstanceRequest;

/**
Expand Down Expand Up @@ -67,7 +67,7 @@ function create_instance(
$disk = (new AttachedDisk())
->setBoot(true)
->setAutoDelete(true)
->setType(Type::PERSISTENT)
->setType(Type::name(Type::PERSISTENT))
->setInitializeParams($diskInitializeParams);

// Use the network interface provided in the $networkName argument.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

# [START compute_instances_create_encrypted]
use Google\Cloud\Compute\V1\AttachedDisk;
use Google\Cloud\Compute\V1\AttachedDisk\Type;
use Google\Cloud\Compute\V1\AttachedDiskInitializeParams;
use Google\Cloud\Compute\V1\Client\InstancesClient;
use Google\Cloud\Compute\V1\CustomerEncryptionKey;
use Google\Cloud\Compute\V1\Enums\AttachedDisk\Type;
use Google\Cloud\Compute\V1\InsertInstanceRequest;

/**
Expand Down Expand Up @@ -78,7 +78,7 @@ function create_instance_with_encryption_key(
$disk = (new AttachedDisk())
->setBoot(true)
->setAutoDelete(true)
->setType(Type::PERSISTENT)
->setType(Type::name(Type::PERSISTENT))
->setInitializeParams($diskInitializeParams)
->setDiskEncryptionKey($customerEncryptionKey);

Expand Down
2 changes: 1 addition & 1 deletion spanner/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"google/cloud-spanner": "^1.97"
"google/cloud-spanner": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions spanner/src/read_stale_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace Google\Cloud\Samples\Spanner;

// [START spanner_read_stale_data]
use Google\Cloud\Spanner\Duration;
use Google\Protobuf\Duration;
use Google\Cloud\Spanner\SpannerClient;

/**
Expand All @@ -49,7 +49,7 @@ function read_stale_data(string $instanceId, string $databaseId): void
'Albums',
$keySet,
['SingerId', 'AlbumId', 'AlbumTitle'],
['exactStaleness' => new Duration(15)]
['exactStaleness' => new Duration(['seconds' => 15])]
);

foreach ($results->rows() as $row) {
Expand Down
2 changes: 1 addition & 1 deletion speech/src/create_recognizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function create_recognizer(
string $projectId,
string $location,
string $recognizerId,
string $model = "latest_short"
string $model = 'latest_short'
): void {
$apiEndpoint = $location === 'global' ? null : sprintf('%s-speech.googleapis.com', $location);
$speech = new SpeechClient(['apiEndpoint' => $apiEndpoint]);
Expand Down
2 changes: 1 addition & 1 deletion speech/src/transcribe_async_gcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function transcribe_async_gcs(string $projectId, string $location, string $recog
$response = $operation->getResult();
foreach ($response->getResults() as $result) {
if ($result->getError()) {
print('Error: '. $result->getError()->getMessage());
print('Error: ' . $result->getError()->getMessage());
}
// get the most likely transcription
$transcript = $result->getInlineResult()->getTranscript();
Expand Down
2 changes: 1 addition & 1 deletion speech/src/transcribe_async_words.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function transcribe_async_words(string $projectId, string $location, string $rec
$response = $operation->getResult();
foreach ($response->getResults() as $result) {
if ($result->getError()) {
print('Error: '. $result->getError()->getMessage());
print('Error: ' . $result->getError()->getMessage());
}
// get the most likely transcription
$transcript = $result->getInlineResult()->getTranscript();
Expand Down