Skip to content

Commit

Permalink
Bug Fix Superbalist#60
Browse files Browse the repository at this point in the history
Fix logic if keyFile is null
  • Loading branch information
ralfiannor authored Apr 25, 2019
1 parent 249a7de commit 387d281
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/GoogleCloudStorageServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,15 @@ public function boot()
private function createClient($config)
{
$keyFile = array_get($config, 'key_file');
if (is_string($keyFile)) {
if (is_array($keyFile)) {
return new StorageClient([
'projectId' => $config['project_id'],
'keyFilePath' => $keyFile,
'keyFile' => array_merge(["project_id" => $config['project_id']], $keyFile)
]);
}

if (! is_array($keyFile)) {
$keyFile = [];
}
return new StorageClient([
'projectId' => $config['project_id'],
'keyFile' => array_merge(["project_id" => $config['project_id']], $keyFile)
'keyFilePath' => $keyFile,
]);
}

Expand Down

0 comments on commit 387d281

Please sign in to comment.