Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 964acd9

Browse filesBrowse files
[HttpClient] add missing argument check
1 parent 4559a65 commit 964acd9
Copy full SHA for 964acd9

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

‎src/Symfony/Component/HttpClient/ScopingHttpClient.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/ScopingHttpClient.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public function __construct(HttpClientInterface $client, array $defaultOptionsBy
3636
$this->client = $client;
3737
$this->defaultOptionsByRegexp = $defaultOptionsByRegexp;
3838
$this->defaultRegexp = $defaultRegexp;
39+
40+
if (null !== $defaultRegexp && !isset($defaultOptionsByRegexp[$defaultRegexp])) {
41+
throw new InvalidArgumentException(sprintf('No options are mapped to the provided "%s" default regexp.', $defaultRegexp));
42+
}
3943
}
4044

4145
public static function forBaseUri(HttpClientInterface $client, string $baseUri, array $defaultOptions = [], $regexp = null): self

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.