@@ -130,7 +130,7 @@ public function uploadList(
130
130
string $ file ,
131
131
GeocodeDirection $ direction ,
132
132
string $ format ,
133
- string $ callbackWebhook = '' ,
133
+ ? string $ callbackWebhook = null ,
134
134
): array {
135
135
if (! file_exists ($ file )) {
136
136
throw GeocodioException::fileNotFound ($ file );
@@ -156,7 +156,7 @@ public function uploadInlineList(
156
156
string $ filename ,
157
157
GeocodeDirection $ direction ,
158
158
string $ format ,
159
- string $ callbackWebhook = '' ,
159
+ ? string $ callbackWebhook = null ,
160
160
): array {
161
161
$ response = $ this ->uploadMultipartFile (
162
162
$ data ,
@@ -295,14 +295,14 @@ protected function uploadMultipartFile(
295
295
string $ fileContents ,
296
296
GeocodeDirection $ direction ,
297
297
string $ format ,
298
- string $ callbackWebhook ,
298
+ ? string $ callbackWebhook = null ,
299
299
?string $ filename = null
300
300
): Response {
301
301
if (is_file ($ fileContents ) && ! file_exists ($ fileContents )) {
302
302
throw GeocodioException::fileNotFound ($ fileContents );
303
303
}
304
304
305
- $ multipart = [
305
+ $ multipart = array_filter ( [
306
306
[
307
307
'name ' => 'file ' ,
308
308
'contents ' => is_file ($ fileContents ) ? fopen ($ fileContents , 'r ' ) : $ fileContents ,
@@ -320,7 +320,7 @@ protected function uploadMultipartFile(
320
320
'name ' => 'callback ' ,
321
321
'contents ' => $ callbackWebhook ,
322
322
],
323
- ];
323
+ ], fn ( $ block ) => $ block [ ' contents ' ]) ;
324
324
325
325
return $ this ->sendRequest ('POST ' , 'lists ' , [RequestOptions::MULTIPART => $ multipart ]);
326
326
}
0 commit comments