Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can actually skip this whole is_array check entirely and just remove the array_merge. The key file should already contain project_id, so I'm not sure why it needs to be merged in the first place?

]);
}

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