Skip to content

Commit 6413141

Browse files
author
Frank Natividad
committed
Address comments
1 parent 7a44547 commit 6413141

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

storage/src/activate_hmac_key.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function activate_hmac_key($accessId, $projectId)
4141

4242
$hmacKey->update('ACTIVE');
4343

44-
print("The HMAC key is now active." . PHP_EOL);
45-
printf("HMAC key Metadata: %s" . PHP_EOL, print_r($hmacKey->info(), true));
44+
print('The HMAC key is now active.' . PHP_EOL);
45+
printf('HMAC key Metadata: %s' . PHP_EOL, print_r($hmacKey->info(), true));
4646
}
4747
# [END storage_activate_hmac_key]

storage/src/create_hmac_key.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ function create_hmac_key($serviceAccountEmail, $projectId)
3939
// By default createHmacKey will use the projectId used by StorageClient().
4040
$hmacKeyCreated = $storage->createHmacKey($serviceAccountEmail, ['projectId' => $projectId]);
4141

42-
printf("The base64 encoded secret is: %s" . PHP_EOL, $hmacKeyCreated->secret());
43-
print("Do not miss that secret, there is no API to recover it." . PHP_EOL);
44-
printf("HMAC key Metadata: %s" . PHP_EOL, print_r($hmacKeyCreated->hmacKey()->info(), true));
42+
printf('The base64 encoded secret is: %s' . PHP_EOL, $hmacKeyCreated->secret());
43+
print('Do not miss that secret, there is no API to recover it.' . PHP_EOL);
44+
printf('HMAC key Metadata: %s' . PHP_EOL, print_r($hmacKeyCreated->hmacKey()->info(), true));
4545
}
4646
# [END storage_create_hmac_key]

storage/src/deactivate_hmac_key.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function deactivate_hmac_key($accessId, $projectId)
4141

4242
$hmacKey->update('INACTIVE');
4343

44-
print("The HMAC key is now inactive." . PHP_EOL);
45-
printf("HMAC key Metadata: %s" . PHP_EOL, print_r($hmacKey->info(), true));
44+
print('The HMAC key is now inactive.' . PHP_EOL);
45+
printf('HMAC key Metadata: %s' . PHP_EOL, print_r($hmacKey->info(), true));
4646
}
4747
# [END storage_deactivate_hmac_key]

storage/src/delete_hmac_key.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ function delete_hmac_key($accessId, $projectId)
4040
$hmacKey = $storage->hmacKey($accessId, $projectId);
4141

4242
$hmacKey->delete();
43-
print("The key is deleted, though it may still appear in results StorageClient.hmacKeys(\$options=['showDeletedKeys'=>true])");
44-
print(" when is used." . PHP_EOL);
43+
print(
44+
'The key is deleted, though it may still appear in the results of calls ' .
45+
'to StorageClient.hmacKeys([\'showDeletedKeys\' => true])' . PHP_EOL
46+
);
4547
}
4648
# [END storage_get_hmac_key]

storage/src/get_hmac_key.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ function get_hmac_key($accessId, $projectId)
3838
$storage = new StorageClient();
3939
$hmacKey = $storage->hmacKey($accessId, $projectId);
4040

41-
printf("HMAC key Metadata: %s" . PHP_EOL, print_r($hmacKey->info(), true));
41+
printf('HMAC key Metadata: %s' . PHP_EOL, print_r($hmacKey->info(), true));
4242
}
4343
# [END storage_get_hmac_key]

storage/src/list_hmac_keys.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function list_hmac_keys($projectId)
3939
$hmacKeys = $storage->hmacKeys(['projectId' => $projectId]);
4040

4141
foreach ($hmacKeys as $hmacKey) {
42-
printf("HMAC key Metadata: %s" . PHP_EOL, print_r($hmacKey->info(), true));
42+
printf('HMAC key Metadata: %s' . PHP_EOL, print_r($hmacKey->info(), true));
4343
}
4444
}
4545
# [END storage_list_hmac_keys]

storage/storage.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,9 @@
490490
} elseif ($input->getOption('delete')) {
491491
delete_hmac_key($accessId, $projectId);
492492
} else {
493-
throw new \Exception('You must provide --activate, --deactivate, --get, or --delete with an HMAC key accessId.');
493+
throw new \Exception(
494+
'You must provide --activate, --deactivate, --get, or --delete with an HMAC key accessId.'
495+
);
494496
}
495497
});
496498

0 commit comments

Comments
 (0)