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 7e246e2

Browse filesBrowse files
Remove deadcode after the bump to PHP >= 8.4
1 parent bf4e553 commit 7e246e2
Copy full SHA for 7e246e2

File tree

Expand file treeCollapse file tree

3 files changed

+2
-13
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+2
-13
lines changed

‎AmpHttpClient.php

Copy file name to clipboardExpand all lines: AmpHttpClient.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
throw new \LogicException('You cannot use "Symfony\Component\HttpClient\AmpHttpClient" as the "amphp/http-client" package is not installed. Try running "composer require amphp/http-client:^4.2.1".');
3737
}
3838

39-
if (\PHP_VERSION_ID < 80400 && is_subclass_of(Request::class, HttpMessage::class)) {
40-
throw new \LogicException('Using "Symfony\Component\HttpClient\AmpHttpClient" with amphp/http-client >= 5 requires PHP >= 8.4. Try running "composer require amphp/http-client:^4.2.1" or upgrade to PHP >= 8.4.');
41-
}
42-
4339
/**
4440
* A portable implementation of the HttpClientInterface contracts based on Amp's HTTP client.
4541
*

‎HttpClient.php

Copy file name to clipboardExpand all lines: HttpClient.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class HttpClient
3131
*/
3232
public static function create(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 50): HttpClientInterface
3333
{
34-
if ($amp = class_exists(AmpRequest::class) && (\PHP_VERSION_ID >= 80400 || !is_subclass_of(AmpRequest::class, HttpMessage::class))) {
34+
if ($amp = class_exists(AmpRequest::class)) {
3535
if (!\extension_loaded('curl')) {
3636
return new AmpHttpClient($defaultOptions, null, $maxHostConnections, $maxPendingPushes);
3737
}

‎NativeHttpClient.php

Copy file name to clipboardExpand all lines: NativeHttpClient.php
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ public function request(string $method, string $url, array $options = []): Respo
8080
if (str_starts_with($options['bindto'], 'host!')) {
8181
$options['bindto'] = substr($options['bindto'], 5);
8282
}
83-
if ((\PHP_VERSION_ID < 80223 || 80300 <= \PHP_VERSION_ID && 80311 < \PHP_VERSION_ID) && '\\' === \DIRECTORY_SEPARATOR && '[' === $options['bindto'][0]) {
84-
$options['bindto'] = preg_replace('{^\[[^\]]++\]}', '[$0]', $options['bindto']);
85-
}
8683
}
8784

8885
$hasContentLength = isset($options['normalized_headers']['content-length']);
@@ -429,11 +426,7 @@ private static function createRedirectResolver(array $options, string $authority
429426
$redirectHeaders['no_auth'] = array_filter($redirectHeaders['no_auth'], $filterContentHeaders);
430427
$redirectHeaders['with_auth'] = array_filter($redirectHeaders['with_auth'], $filterContentHeaders);
431428

432-
if (\PHP_VERSION_ID >= 80300) {
433-
stream_context_set_options($context, ['http' => $options]);
434-
} else {
435-
stream_context_set_option($context, ['http' => $options]);
436-
}
429+
stream_context_set_options($context, ['http' => $options]);
437430
}
438431
}
439432

0 commit comments

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