Skip to content

Commit 55a102f

Browse files
authored
chore: add typehints for storage samples (GoogleCloudPlatform#1703)
1 parent 55f6e2c commit 55a102f

File tree

97 files changed

+101
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+101
-101
lines changed

storage/src/activate_hmac_key.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @param string $projectId The ID of your Google Cloud Platform project.
3333
* @param string $accessId Access ID for an inactive HMAC key.
3434
*/
35-
function activate_hmac_key($projectId, $accessId)
35+
function activate_hmac_key(string $projectId, string $accessId): void
3636
{
3737
// $projectId = 'my-project-id';
3838
// $accessId = 'GOOG0234230X00';

storage/src/add_bucket_acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @param string $entity The entity for which to update access controls.
3434
* @param string $role The permissions to add for the specified entity.
3535
*/
36-
function add_bucket_acl($bucketName, $entity, $role)
36+
function add_bucket_acl(string $bucketName, string $entity, string $role): void
3737
{
3838
// $bucketName = 'my-bucket';
3939
// $entity = 'user-example@domain.com';

storage/src/add_bucket_conditional_iam_binding.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* To see how to express a condition in CEL, visit:
4040
* @see https://cloud.google.com/storage/docs/access-control/iam#conditions.
4141
*/
42-
function add_bucket_conditional_iam_binding($bucketName, $role, array $members, $title, $description, $expression)
42+
function add_bucket_conditional_iam_binding(string $bucketName, string $role, array $members, string $title, string $description, string $expression): void
4343
{
4444
// $bucketName = 'my-bucket';
4545
// $role = 'roles/storage.objectViewer';

storage/src/add_bucket_default_acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @param string $entity The entity for which to update access controls.
3434
* @param string $role The permissions to add for the specified entity.
3535
*/
36-
function add_bucket_default_acl($bucketName, $entity, $role)
36+
function add_bucket_default_acl(string $bucketName, string $entity, string $role): void
3737
{
3838
// $bucketName = 'my-bucket';
3939
// $entity = 'user-example@domain.com';

storage/src/add_bucket_iam_member.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @param string $role The role to which the given member should be added.
3434
* @param string[] $members The member(s) to be added to the role.
3535
*/
36-
function add_bucket_iam_member($bucketName, $role, array $members)
36+
function add_bucket_iam_member(string $bucketName, string $role, array $members): void
3737
{
3838
// $bucketName = 'my-bucket';
3939
// $role = 'roles/storage.objectViewer';

storage/src/add_bucket_label.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @param string $labelName The name of the label to add.
3434
* @param string $labelValue The value of the label to add.
3535
*/
36-
function add_bucket_label($bucketName, $labelName, $labelValue)
36+
function add_bucket_label(string $bucketName, string $labelName, string $labelValue): void
3737
{
3838
// $bucketName = 'my-bucket';
3939
// $labelName = 'label-key-to-add';

storage/src/add_object_acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @param string $entity The entity for which to update access controls.
3535
* @param string $role The permissions to add for the specified entity.
3636
*/
37-
function add_object_acl($bucketName, $objectName, $entity, $role)
37+
function add_object_acl(string $bucketName, string $objectName, string $entity, string $role): void
3838
{
3939
// $bucketName = 'my-bucket';
4040
// $objectName = 'my-object';

storage/src/bucket_delete_default_kms_key.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
* @param string $bucketName The name of your Cloud Storage bucket.
3333
*/
34-
function bucket_delete_default_kms_key($bucketName)
34+
function bucket_delete_default_kms_key(string $bucketName): void
3535
{
3636
// $bucketName = 'my-bucket';
3737

storage/src/change_default_storage_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
* @param string $bucketName The name of your Cloud Storage bucket.
3333
*/
34-
function change_default_storage_class($bucketName)
34+
function change_default_storage_class(string $bucketName): void
3535
{
3636
// $bucketName = 'my-bucket';
3737

storage/src/change_file_storage_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @param string $objectName The name of your Cloud Storage object.
3434
* @param string $storageClass The storage class of the new object.
3535
*/
36-
function change_file_storage_class($bucketName, $objectName, $storageClass)
36+
function change_file_storage_class(string $bucketName, string $objectName, string $storageClass): void
3737
{
3838
// $bucketName = 'my-bucket';
3939
// $objectName = 'my-object';

0 commit comments

Comments
 (0)