File tree 1 file changed +4
-6
lines changed
Filter options
src/Symfony/Component/HttpClient 1 file changed +4
-6
lines changed
Original file line number Diff line number Diff line change @@ -208,9 +208,8 @@ private static function mergeDefaultOptions(array $options, array $defaultOption
208
208
$ options ['resolve ' ] = [];
209
209
foreach ($ resolve as $ k => $ v ) {
210
210
if ('' === $ v = (string ) $ v ) {
211
- throw new InvalidArgumentException (sprintf ('Option "resolve" for host "%s" cannot be empty. ' , $ k ));
212
- }
213
- if ('[ ' === $ v [0 ] && '] ' === substr ($ v , -1 ) && str_contains ($ v , ': ' )) {
211
+ $ v = null ;
212
+ } elseif ('[ ' === $ v [0 ] && '] ' === substr ($ v , -1 ) && str_contains ($ v , ': ' )) {
214
213
$ v = substr ($ v , 1 , -1 );
215
214
}
216
215
@@ -238,9 +237,8 @@ private static function mergeDefaultOptions(array $options, array $defaultOption
238
237
if ($ resolve = $ defaultOptions ['resolve ' ] ?? false ) {
239
238
foreach ($ resolve as $ k => $ v ) {
240
239
if ('' === $ v = (string ) $ v ) {
241
- throw new InvalidArgumentException (sprintf ('Option "resolve" for host "%s" cannot be empty. ' , $ k ));
242
- }
243
- if ('[ ' === $ v [0 ] && '] ' === substr ($ v , -1 ) && str_contains ($ v , ': ' )) {
240
+ $ v = null ;
241
+ } elseif ('[ ' === $ v [0 ] && '] ' === substr ($ v , -1 ) && str_contains ($ v , ': ' )) {
244
242
$ v = substr ($ v , 1 , -1 );
245
243
}
246
244
You can’t perform that action at this time.
0 commit comments