From 833cf93209637d4e88530d08db7e8cc932d0549f Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 5 Nov 2022 09:35:06 +0100 Subject: [PATCH] address Scrutinizer warning > The variable $bucket does not seem to be defined for all execution paths leading up to this point. --- lib/Data/GoogleCloudStorage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Data/GoogleCloudStorage.php b/lib/Data/GoogleCloudStorage.php index dd2aff3..e07e818 100644 --- a/lib/Data/GoogleCloudStorage.php +++ b/lib/Data/GoogleCloudStorage.php @@ -67,7 +67,9 @@ class GoogleCloudStorage extends AbstractData $this->_client = class_exists('StorageClientStub', false) ? new \StorageClientStub(array()) : new StorageClient(array('suppressKeyFileNotice' => true)); - $this->_bucket = $this->_client->bucket($bucket); + if (isset($bucket)) { + $this->_bucket = $this->_client->bucket($bucket); + } } /**