Skip to content

Commit

Permalink
Code style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlemke committed Aug 15, 2019
1 parent 6ece504 commit f9c7526
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Classes/GcsStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ protected function importTemporaryFile($temporaryPathAndFilename, $collectionNam
/**
* @return Bucket
*/
protected function getCurrentBucket()
protected function getCurrentBucket(): Bucket
{
if ($this->currentBucket === null) {
$this->currentBucket = $this->storageClient->bucket($this->bucketName);
Expand Down
7 changes: 4 additions & 3 deletions Classes/StorageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

use Google\Cloud\Core\ServiceBuilder;
use Google\Cloud\Storage\StorageClient;
use Neos\Flow\Annotations as Flow;

/**
Expand All @@ -37,10 +38,10 @@ class StorageFactory
* Creates a new Storage instance and authenticates against the Google API
*
* @param string $credentialsProfileName
* @return \Google\Cloud\Storage\StorageClient
* @return StorageClient
* @throws Exception
*/
public function create($credentialsProfileName = 'default')
public function create($credentialsProfileName = 'default'): StorageClient
{
if (!isset($this->credentialProfiles[$credentialsProfileName])) {
throw new Exception(sprintf('The specified Google Cloud Storage credentials profile "%s" does not exist, please check your settings.', $credentialsProfileName), 1446553024);
Expand All @@ -51,7 +52,7 @@ public function create($credentialsProfileName = 'default')
'keyFile' => json_decode(base64_decode($this->credentialProfiles[$credentialsProfileName]['credentials']['privateKeyJsonBase64Encoded']), true)
]);
} else {
if (substr($this->credentialProfiles[$credentialsProfileName]['credentials']['privateKeyJsonPathAndFilename'], 0, 1) !== '/') {
if (strpos($this->credentialProfiles[$credentialsProfileName]['credentials']['privateKeyJsonPathAndFilename'], '/') !== 0) {
$privateKeyPathAndFilename = FLOW_PATH_ROOT . $this->credentialProfiles[$credentialsProfileName]['credentials']['privateKeyJsonPathAndFilename'];
} else {
$privateKeyPathAndFilename = $this->credentialProfiles[$credentialsProfileName]['credentials']['privateKeyJsonPathAndFilename'];
Expand Down

0 comments on commit f9c7526

Please sign in to comment.