Ver Fonte

address Scrutinizer warning

> The variable $bucket does not seem to be defined for all execution paths leading up to this point.
El RIDO há 3 anos atrás
pai
commit
833cf93209
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      lib/Data/GoogleCloudStorage.php

+ 3 - 1
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);
+        }
     }
 
     /**