Skip to content

Commit 052bc4f

Browse files
[HttpClient] Deprecate using amphp/http-client < 5
1 parent 3fe77f0 commit 052bc4f

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

UPGRADE-7.4.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
UPGRADE FROM 7.3 to 7.4
2+
=======================
3+
4+
Symfony 7.4 is a minor release. According to the Symfony release process, there should be no significant
5+
backward compatibility breaks. Minor backward compatibility breaks are prefixed in this document with
6+
`[BC BREAK]`, make sure your code is compatible with these entries before upgrading.
7+
Read more about this in the [Symfony documentation](https://symfony.com/doc/7.4/setup/upgrade_minor.html).
8+
9+
If you're upgrading from a version below 7.3, follow the [7.3 upgrade guide](UPGRADE-7.3.md) first.
10+
11+
HttpClient
12+
----------
13+
14+
* Deprecate using amphp/http-client < 5

src/Symfony/Component/HttpClient/AmpHttpClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public function __construct(array $defaultOptions = [], ?callable $clientConfigu
7878
if (is_subclass_of(Request::class, HttpMessage::class)) {
7979
$this->multi = new AmpClientStateV5($clientConfigurator, $maxHostConnections, $maxPendingPushes, $this->logger);
8080
} else {
81+
if (\PHP_VERSION_ID >= 80400) {
82+
trigger_deprecation('symfony/http-client', '7.4', 'Using amphp/http-client < 5 is deprecated. Try running "composer require amphp/http-client:^5".');
83+
}
8184
$this->multi = new AmpClientStateV4($clientConfigurator, $maxHostConnections, $maxPendingPushes, $this->logger);
8285
}
8386
}

src/Symfony/Component/HttpClient/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.4
5+
---
6+
7+
* Deprecate using amphp/http-client < 5
8+
49
7.3
510
---
611

src/Symfony/Component/HttpClient/HttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function create(array $defaultOptions = [], int $maxHostConnection
6262
return new AmpHttpClient($defaultOptions, null, $maxHostConnections, $maxPendingPushes);
6363
}
6464

65-
@trigger_error((\extension_loaded('curl') ? 'Upgrade' : 'Install').' the curl extension or run "composer require amphp/http-client:^4.2.1" to perform async HTTP operations, including full HTTP/2 support', \E_USER_NOTICE);
65+
@trigger_error((\extension_loaded('curl') ? 'Upgrade' : 'Install').' the curl extension or run "composer require amphp/http-client:^5" to perform async HTTP operations, including full HTTP/2 support', \E_USER_NOTICE);
6666

6767
return new NativeHttpClient($defaultOptions, $maxHostConnections);
6868
}

0 commit comments

Comments
 (0)