Skip to content

Commit f3d9937

Browse files
committed
Add typehints
1 parent 72b93b8 commit f3d9937

31 files changed

+144
-144
lines changed

kms/src/create_key_asymmetric_decrypt.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2626

2727
function create_key_asymmetric_decrypt_sample(
28-
$projectId = 'my-project',
29-
$locationId = 'us-east1',
30-
$keyRingId = 'my-key-ring',
31-
$id = 'my-asymmetric-decrypt-key'
28+
string $projectId = 'my-project',
29+
string $locationId = 'us-east1',
30+
string $keyRingId = 'my-key-ring',
31+
string $id = 'my-asymmetric-decrypt-key'
3232
) {
3333
// Create the Cloud KMS client.
3434
$client = new KeyManagementServiceClient();

kms/src/create_key_asymmetric_sign.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2626

2727
function create_key_asymmetric_sign_sample(
28-
$projectId = 'my-project',
29-
$locationId = 'us-east1',
30-
$keyRingId = 'my-key-ring',
31-
$id = 'my-asymmetric-signing-key'
28+
string $projectId = 'my-project',
29+
string $locationId = 'us-east1',
30+
string $keyRingId = 'my-key-ring',
31+
string $id = 'my-asymmetric-signing-key'
3232
) {
3333
// Create the Cloud KMS client.
3434
$client = new KeyManagementServiceClient();

kms/src/create_key_hsm.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
use Google\Cloud\Kms\V1\ProtectionLevel;
2727

2828
function create_key_hsm_sample(
29-
$projectId = 'my-project',
30-
$locationId = 'us-east1',
31-
$keyRingId = 'my-key-ring',
32-
$id = 'my-hsm-key'
29+
string $projectId = 'my-project',
30+
string $locationId = 'us-east1',
31+
string $keyRingId = 'my-key-ring',
32+
string $id = 'my-hsm-key'
3333
) {
3434
// Create the Cloud KMS client.
3535
$client = new KeyManagementServiceClient();

kms/src/create_key_labels.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2626

2727
function create_key_labels_sample(
28-
$projectId = 'my-project',
29-
$locationId = 'us-east1',
30-
$keyRingId = 'my-key-ring',
31-
$id = 'my-key-with-labels'
28+
string $projectId = 'my-project',
29+
string $locationId = 'us-east1',
30+
string $keyRingId = 'my-key-ring',
31+
string $id = 'my-key-with-labels'
3232
) {
3333
// Create the Cloud KMS client.
3434
$client = new KeyManagementServiceClient();

kms/src/create_key_ring.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
use Google\Cloud\Kms\V1\KeyRing;
2323

2424
function create_key_ring_sample(
25-
$projectId = 'my-project',
26-
$locationId = 'us-east1',
27-
$id = 'my-key-ring'
25+
string $projectId = 'my-project',
26+
string $locationId = 'us-east1',
27+
string $id = 'my-key-ring'
2828
) {
2929
// Create the Cloud KMS client.
3030
$client = new KeyManagementServiceClient();

kms/src/create_key_rotation_schedule.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
use Google\Protobuf\Timestamp;
2828

2929
function create_key_rotation_schedule_sample(
30-
$projectId = 'my-project',
31-
$locationId = 'us-east1',
32-
$keyRingId = 'my-key-ring',
33-
$id = 'my-key-with-rotation-schedule'
30+
string $projectId = 'my-project',
31+
string $locationId = 'us-east1',
32+
string $keyRingId = 'my-key-ring',
33+
string $id = 'my-key-with-rotation-schedule'
3434
) {
3535
// Create the Cloud KMS client.
3636
$client = new KeyManagementServiceClient();

kms/src/create_key_symmetric_encrypt_decrypt.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2626

2727
function create_key_symmetric_encrypt_decrypt_sample(
28-
$projectId = 'my-project',
29-
$locationId = 'us-east1',
30-
$keyRingId = 'my-key-ring',
31-
$id = 'my-symmetric-key'
28+
string $projectId = 'my-project',
29+
string $locationId = 'us-east1',
30+
string $keyRingId = 'my-key-ring',
31+
string $id = 'my-symmetric-key'
3232
) {
3333
// Create the Cloud KMS client.
3434
$client = new KeyManagementServiceClient();

kms/src/create_key_version.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2323

2424
function create_key_version_sample(
25-
$projectId = 'my-project',
26-
$locationId = 'us-east1',
27-
$keyRingId = 'my-key-ring',
28-
$keyId = 'my-key'
25+
string $projectId = 'my-project',
26+
string $locationId = 'us-east1',
27+
string $keyRingId = 'my-key-ring',
28+
string $keyId = 'my-key'
2929
) {
3030
// Create the Cloud KMS client.
3131
$client = new KeyManagementServiceClient();

kms/src/decrypt_asymmetric.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function decrypt_asymmetric_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key',
28-
$versionId = '123',
29-
$ciphertext = '...'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key',
28+
string $versionId = '123',
29+
string $ciphertext = '...'
3030
) {
3131
// Create the Cloud KMS client.
3232
$client = new KeyManagementServiceClient();

kms/src/decrypt_symmetric.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function decrypt_symmetric_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key',
28-
$ciphertext = '...'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key',
28+
string $ciphertext = '...'
2929
) {
3030
// Create the Cloud KMS client.
3131
$client = new KeyManagementServiceClient();

kms/src/destroy_key_version.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function destroy_key_version_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key',
28-
$versionId = '123'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key',
28+
string $versionId = '123'
2929
) {
3030
// Create the Cloud KMS client.
3131
$client = new KeyManagementServiceClient();

kms/src/disable_key_version.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
use Google\Protobuf\FieldMask;
2525

2626
function disable_key_version_sample(
27-
$projectId = 'my-project',
28-
$locationId = 'us-east1',
29-
$keyRingId = 'my-key-ring',
30-
$keyId = 'my-key',
31-
$versionId = '123'
27+
string $projectId = 'my-project',
28+
string $locationId = 'us-east1',
29+
string $keyRingId = 'my-key-ring',
30+
string $keyId = 'my-key',
31+
string $versionId = '123'
3232
) {
3333
// Create the Cloud KMS client.
3434
$client = new KeyManagementServiceClient();

kms/src/enable_key_version.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
use Google\Protobuf\FieldMask;
2525

2626
function enable_key_version_sample(
27-
$projectId = 'my-project',
28-
$locationId = 'us-east1',
29-
$keyRingId = 'my-key-ring',
30-
$keyId = 'my-key',
31-
$versionId = '123'
27+
string $projectId = 'my-project',
28+
string $locationId = 'us-east1',
29+
string $keyRingId = 'my-key-ring',
30+
string $keyId = 'my-key',
31+
string $versionId = '123'
3232
) {
3333
// Create the Cloud KMS client.
3434
$client = new KeyManagementServiceClient();

kms/src/encrypt_asymmetric.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
// [START kms_encrypt_asymmetric]
2121
function encrypt_asymmetric_sample(
22-
$projectId = 'my-project',
23-
$locationId = 'us-east1',
24-
$keyRingId = 'my-key-ring',
25-
$keyId = 'my-key',
26-
$versionId = '123',
27-
$plaintext = '...'
22+
string $projectId = 'my-project',
23+
string $locationId = 'us-east1',
24+
string $keyRingId = 'my-key-ring',
25+
string $keyId = 'my-key',
26+
string $versionId = '123',
27+
string $plaintext = '...'
2828
) {
2929
// PHP has limited support for asymmetric encryption operations.
3030
// Specifically, openssl_public_encrypt() does not allow customizing

kms/src/encrypt_symmetric.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function encrypt_symmetric_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key',
28-
$plaintext = '...'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key',
28+
string $plaintext = '...'
2929
) {
3030
// Create the Cloud KMS client.
3131
$client = new KeyManagementServiceClient();

kms/src/get_key_labels.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function get_key_labels_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key'
2828
) {
2929
// Create the Cloud KMS client.
3030
$client = new KeyManagementServiceClient();

kms/src/get_key_version_attestation.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function get_key_version_attestation_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key',
28-
$versionId = '123'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key',
28+
string $versionId = '123'
2929
) {
3030
// Create the Cloud KMS client.
3131
$client = new KeyManagementServiceClient();

kms/src/get_public_key.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function get_public_key_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key',
28-
$versionId = '123'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key',
28+
string $versionId = '123'
2929
) {
3030
// Create the Cloud KMS client.
3131
$client = new KeyManagementServiceClient();

kms/src/iam_add_member.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2323

2424
function iam_add_member_sample(
25-
$projectId = 'my-project',
26-
$locationId = 'us-east1',
27-
$keyRingId = 'my-key-ring',
28-
$keyId = 'my-key',
29-
$member = 'user:[email protected]'
25+
string $projectId = 'my-project',
26+
string $locationId = 'us-east1',
27+
string $keyRingId = 'my-key-ring',
28+
string $keyId = 'my-key',
29+
string $member = 'user:[email protected]'
3030
) {
3131
// Create the Cloud KMS client.
3232
$client = new KeyManagementServiceClient();

kms/src/iam_get_policy.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function iam_get_policy_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key'
2828
) {
2929
// Create the Cloud KMS client.
3030
$client = new KeyManagementServiceClient();

kms/src/iam_remove_member.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2424

2525
function iam_remove_member_sample(
26-
$projectId = 'my-project',
27-
$locationId = 'us-east1',
28-
$keyRingId = 'my-key-ring',
29-
$keyId = 'my-key',
30-
$member = 'user:[email protected]'
26+
string $projectId = 'my-project',
27+
string $locationId = 'us-east1',
28+
string $keyRingId = 'my-key-ring',
29+
string $keyId = 'my-key',
30+
string $member = 'user:[email protected]'
3131
) {
3232
// Create the Cloud KMS client.
3333
$client = new KeyManagementServiceClient();

kms/src/quickstart.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function quickstart_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1'
2626
) {
2727
// Create the Cloud KMS client.
2828
$client = new KeyManagementServiceClient();

kms/src/restore_key_version.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
use Google\Cloud\Kms\V1\KeyManagementServiceClient;
2222

2323
function restore_key_version_sample(
24-
$projectId = 'my-project',
25-
$locationId = 'us-east1',
26-
$keyRingId = 'my-key-ring',
27-
$keyId = 'my-key',
28-
$versionId = '123'
24+
string $projectId = 'my-project',
25+
string $locationId = 'us-east1',
26+
string $keyRingId = 'my-key-ring',
27+
string $keyId = 'my-key',
28+
string $versionId = '123'
2929
) {
3030
// Create the Cloud KMS client.
3131
$client = new KeyManagementServiceClient();

kms/src/sign_asymmetric.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
use Google\Cloud\Kms\V1\Digest;
2323

2424
function sign_asymmetric_sample(
25-
$projectId = 'my-project',
26-
$locationId = 'us-east1',
27-
$keyRingId = 'my-key-ring',
28-
$keyId = 'my-key',
29-
$versionId = '123',
30-
$message = '...'
25+
string $projectId = 'my-project',
26+
string $locationId = 'us-east1',
27+
string $keyRingId = 'my-key-ring',
28+
string $keyId = 'my-key',
29+
string $versionId = '123',
30+
string $message = '...'
3131
) {
3232
// Create the Cloud KMS client.
3333
$client = new KeyManagementServiceClient();

0 commit comments

Comments
 (0)