Skip to content

Commit

Permalink
chore: mark connection classes and ConnectionInterface as deprecated …
Browse files Browse the repository at this point in the history
…(#6616)
  • Loading branch information
saranshdhingra authored Sep 15, 2023
1 parent eb45a0a commit 674d067
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Acl

/**
* @var ConnectionInterface Represents a connection to Cloud Storage.
* @internal
*/
protected $connection;

Expand All @@ -55,7 +56,8 @@ class Acl

/**
* @param ConnectionInterface $connection Represents a connection to
* Cloud Storage.
* Cloud Storage. This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param string $type The type of access control this instance applies to.
* @param array $identity Represents which bucket, file, or generation this
* instance applies to.
Expand Down
4 changes: 3 additions & 1 deletion src/Bucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Bucket

/**
* @var ConnectionInterface Represents a connection to Cloud Storage.
* @internal
*/
private $connection;

Expand Down Expand Up @@ -95,7 +96,8 @@ class Bucket

/**
* @param ConnectionInterface $connection Represents a connection to Cloud
* Storage.
* Storage. This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param string $name The bucket's name.
* @param array $info [optional] The bucket's metadata.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Connection/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
/**
* Represents a connection to
* [Cloud Storage](https://cloud.google.com/storage/).
*
* @internal
*/
interface ConnectionInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Connection/IamBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

/**
* IAM Implementation for GCS Buckets
*
* @internal
*/
class IamBucket implements IamConnectionInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Connection/Rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
/**
* Implementation of the
* [Google Cloud Storage JSON API](https://cloud.google.com/storage/docs/json_api/).
*
* @internal
*/
class Rest implements ConnectionInterface
{
Expand Down
3 changes: 3 additions & 0 deletions src/HmacKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class HmacKey
{
/**
* @var ConnectionInterface
* @internal
*/
private $connection;

Expand All @@ -54,6 +55,8 @@ class HmacKey

/**
* @param ConnectionInterface $connection A connection to Cloud Storage.
* This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param string $projectId The current project ID.
* @param string $accessId The key identifier.
* @param array|null $info The key metadata.
Expand Down
4 changes: 3 additions & 1 deletion src/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Notification

/**
* @var ConnectionInterface Represents a connection to Cloud Storage.
* @internal
*/
private $connection;

Expand All @@ -70,7 +71,8 @@ class Notification

/**
* @param ConnectionInterface $connection Represents a connection to Cloud
* Storage.
* Storage. This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param string $id The notification's ID.
* @param string $bucket The name of the bucket associated with this
* notification.
Expand Down
13 changes: 10 additions & 3 deletions src/SigningHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public static function getHelper()
* Sign using the version inferred from `$options.version`.
*
* @param ConnectionInterface $connection A connection to the Cloud Storage
* API.
* API. This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param Timestamp|\DateTimeInterface|int $expires The signed URL
* expiration.
* @param string $resource The URI to the storage resource, preceded by a
Expand Down Expand Up @@ -110,7 +111,8 @@ public function sign(ConnectionInterface $connection, $expires, $resource, $gene
* This method will be deprecated in the future.
*
* @param ConnectionInterface $connection A connection to the Cloud Storage
* API.
* API. This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param Timestamp|\DateTimeInterface|int $expires The signed URL
* expiration.
* @param string $resource The URI to the storage resource, preceded by a
Expand Down Expand Up @@ -206,7 +208,8 @@ public function v2Sign(ConnectionInterface $connection, $expires, $resource, $ge
* Sign a storage URL using Google Signed URLs v4.
*
* @param ConnectionInterface $connection A connection to the Cloud Storage
* API.
* API. This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param Timestamp|\DateTimeInterface|int $expires The signed URL
* expiration.
* @param string $resource The URI to the storage resource, preceded by a
Expand Down Expand Up @@ -362,6 +365,8 @@ public function v4Sign(ConnectionInterface $connection, $expires, $resource, $ge
* Create an HTTP POST policy using v4 signing.
*
* @param ConnectionInterface $connection A Connection to Google Cloud Storage.
* This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param Timestamp|\DateTimeInterface|int $expires The signed URL
* expiration.
* @param string $resource The URI to the storage resource, preceded by a
Expand Down Expand Up @@ -780,6 +785,8 @@ private function normalizeCanonicalRequestResource($resource, $bucketBoundHostna
* Get the credentials for use with signing.
*
* @param ConnectionInterface $connection A Storage connection object.
* This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param array $options Configuration options.
* @return array A list containing a credentials object at index 0 and the
* modified options at index 1.
Expand Down
1 change: 1 addition & 0 deletions src/StorageClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class StorageClient

/**
* @var ConnectionInterface Represents a connection to Storage.
* @internal
*/
protected $connection;

Expand Down
4 changes: 3 additions & 1 deletion src/StorageObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class StorageObject

/**
* @var ConnectionInterface Represents a connection to Cloud Storage.
* @internal
*/
protected $connection;

Expand All @@ -77,7 +78,8 @@ class StorageObject

/**
* @param ConnectionInterface $connection Represents a connection to Cloud
* Storage.
* Storage. This object is created by StorageClient,
* and should not be instantiated outside of this client.
* @param string $name The object's name.
* @param string $bucket The name of the bucket the object is contained in.
* @param string $generation [optional] The generation of the object.
Expand Down

0 comments on commit 674d067

Please sign in to comment.