This repository was archived by the owner on Jul 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " superbalist /laravel-google-cloud-storage" ,
2
+ "name" : " superchairon /laravel-google-cloud-storage" ,
3
3
"description" : " A Google Cloud Storage filesystem for Laravel" ,
4
4
"license" : " MIT" ,
5
5
"authors" : [
Original file line number Diff line number Diff line change @@ -84,21 +84,24 @@ public function boot()
84
84
*/
85
85
private function createClient ($ config )
86
86
{
87
- $ keyFile = array_get ($ config , 'key_file ' );
88
- if (is_string ($ keyFile )) {
89
- return new StorageClient ([
90
- 'projectId ' => $ config ['project_id ' ],
91
- 'keyFilePath ' => $ keyFile ,
92
- ]);
87
+ $ options = [];
88
+ if (isset ($ config ['project_id ' ])) {
89
+ $ options ['projectId ' ] = $ config ['project_id ' ];
93
90
}
94
91
95
- if (! is_array ($ keyFile )) {
96
- $ keyFile = [];
92
+ if (isset ($ config ['key_file ' ])) {
93
+ $ keyFile = array_get ($ config , 'key_file ' );
94
+ if (is_string ($ keyFile )) {
95
+ $ options ['keyFilePath ' ] = $ keyFile ;
96
+ } else {
97
+ if (! is_array ($ keyFile )) {
98
+ $ keyFile = [];
99
+ }
100
+ $ options ['keyFile ' ] = array_merge (["project_id " => $ config ['project_id ' ]], $ keyFile );
101
+ }
97
102
}
98
- return new StorageClient ([
99
- 'projectId ' => $ config ['project_id ' ],
100
- 'keyFile ' => array_merge (["project_id " => $ config ['project_id ' ]], $ keyFile )
101
- ]);
103
+
104
+ return new StorageClient ($ options );
102
105
}
103
106
104
107
/**
You can’t perform that action at this time.
0 commit comments