Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Aayush Kadam committed Dec 10, 2024
1 parent 3e18c55 commit 4b958a0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
9 changes: 4 additions & 5 deletions spanner/src/create_backup_schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function create_backup_schedule(
$databaseFullName = DatabaseAdminClient::databaseName($projectId, $instanceId, $databaseId);
printf('%s', $databaseFullName);

$encryptionConfig = ( new CreateBackupEncryptionConfig() )
-> setEncryptionType(EncryptionType::USE_DATABASE_ENCRYPTION);
$encryptionConfig = (new CreateBackupEncryptionConfig())
->setEncryptionType(EncryptionType::USE_DATABASE_ENCRYPTION);
$backupSchedule = new BackupSchedule([
'full_backup_spec' => new FullBackupSpec(),
'retention_duration' => (new Duration())
Expand All @@ -78,11 +78,10 @@ function create_backup_schedule(

$operation = $databaseAdminClient->createBackupSchedule($request);

printf('Created backup scehedule %s' . PHP_EOL, $operation->getName());
printf('Created backup scehedule %s' . PHP_EOL, $operation->getName());
}
// [END spanner_create_backup_schedule]

// The following 2 lines are only needed to run the samples
require_once __DIR__ . '/../../testing/sample_helpers.php';
\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);

\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);
5 changes: 3 additions & 2 deletions spanner/src/delete_backup_schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ function delete_backup_schedule(
$databaseAdminClient = new DatabaseAdminClient();

$backupScheduleName = sprintf(
'projects/%s/instances/%s/databases/%s/backupSchedules/%s',
'projects/%s/instances/%s/databases/%s/backupSchedules/%s',
$projectId,
$instanceId,
$databaseId,
$backupScheduleId);
$backupScheduleId
);
$request = new DeleteBackupScheduleRequest([
'name' => strval($backupScheduleName),
]);
Expand Down
5 changes: 3 additions & 2 deletions spanner/src/get_backup_schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ function get_backup_schedule(
$databaseAdminClient = new DatabaseAdminClient();

$backupScheduleName = sprintf(
'projects/%s/instances/%s/databases/%s/backupSchedules/%s',
'projects/%s/instances/%s/databases/%s/backupSchedules/%s',
$projectId,
$instanceId,
$databaseId,
$backupScheduleId);
$backupScheduleId
);
$request = new GetBackupScheduleRequest([
'name' => $backupScheduleName,
]);
Expand Down
5 changes: 2 additions & 3 deletions spanner/src/list_backup_schedules.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ function list_backup_schedules(
$operation = $databaseAdminClient->listBackupSchedules($request);

printf("Backup schedules for database %s" . PHP_EOL, $databaseFullName);
foreach($operation as $schedule) {
foreach ($operation as $schedule) {
printf("Backup schedule: %s" . PHP_EOL, $schedule->getName());
}
}
// [END spanner_list_backup_schedules]

// The following 2 lines are only needed to run the samples
require_once __DIR__ . '/../../testing/sample_helpers.php';
\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);

\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);
12 changes: 6 additions & 6 deletions spanner/src/update_backup_schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ function update_backup_schedule(
'encryption_type' => EncryptionType::USE_DATABASE_ENCRYPTION,
]);
$backupScheduleName = sprintf(
'projects/%s/instances/%s/databases/%s/backupSchedules/%s',
'projects/%s/instances/%s/databases/%s/backupSchedules/%s',
$projectId,
$instanceId,
$databaseId,
$backupScheduleId);
$backupScheduleId
);
$backupSchedule = new BackupSchedule([
'name' => $backupScheduleName,
'full_backup_spec' => new FullBackupSpec(),
Expand All @@ -82,7 +83,7 @@ function update_backup_schedule(
'retention_duration',
'spec.cron_spec.text',
'encryption_config',
]);
]);

$request = new UpdateBackupScheduleRequest([
'backup_schedule' => $backupSchedule,
Expand All @@ -91,11 +92,10 @@ function update_backup_schedule(

$operation = $databaseAdminClient->updateBackupSchedule($request);

printf('Updated backup scehedule %s' . PHP_EOL, $operation->getName());
printf('Updated backup scehedule %s' . PHP_EOL, $operation->getName());
}
// [END spanner_update_backup_schedule]

// The following 2 lines are only needed to run the samples
require_once __DIR__ . '/../../testing/sample_helpers.php';
\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);

\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);
2 changes: 1 addition & 1 deletion spanner/test/spannerBackupScheduleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ public static function tearDownAfterClass(): void
}
}
}
}
}

0 comments on commit 4b958a0

Please sign in to comment.