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

[HttpClient] Fix deprecation on PHP 8.3 #54102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 29, 2024
Merged
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
[HttpClient] Fix deprecation on PHP 8.3
  • Loading branch information
nicolas-grekas committed Feb 28, 2024
commit 9407a1b07ef8a59812762326ef8ce856798529d6
6 changes: 5 additions & 1 deletion 6 src/Symfony/Component/HttpClient/NativeHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ private static function createRedirectResolver(array $options, string $host, ?ar
$redirectHeaders['no_auth'] = array_filter($redirectHeaders['no_auth'], $filterContentHeaders);
$redirectHeaders['with_auth'] = array_filter($redirectHeaders['with_auth'], $filterContentHeaders);

stream_context_set_option($context, ['http' => $options]);
if (\PHP_VERSION_ID >= 80300) {
stream_context_set_options($context, ['http' => $options]);
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we define a polyfill for stream_context_set_options in symfony/polyfill-php83 and then always use it ?

Copy link
Member Author

Choose a reason for hiding this comment

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

there's one already but I thought this was simple enough to fix without the polyfill

} else {
stream_context_set_option($context, ['http' => $options]);
}
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.