Skip to content

Commit 78467e6

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

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

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)