Skip to content

Commit ab9cefc

Browse files
[HttpClient] Add PSR-18 to HttplugClient since HTTPlug is deprecated
1 parent 1f8c592 commit ab9cefc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Symfony/Component/HttpClient/HttplugClient.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Nyholm\Psr7\Factory\Psr17Factory;
2727
use Nyholm\Psr7\Request;
2828
use Nyholm\Psr7\Uri;
29+
use Psr\Http\Client\ClientInterface;
2930
use Psr\Http\Message\RequestFactoryInterface;
3031
use Psr\Http\Message\RequestInterface;
3132
use Psr\Http\Message\ResponseFactoryInterface;
@@ -53,6 +54,10 @@
5354
throw new \LogicException('You cannot use the "Symfony\Component\HttpClient\HttplugClient" as the "psr/http-factory" package is not installed. Try running "composer require nyholm/psr7".');
5455
}
5556

57+
if (!interface_exists(ClientInterface::class)) {
58+
throw new \LogicException('You cannot use "Symfony\Component\HttpClient\HttplugClient" as the "psr/http-client" package is not installed. Try running "composer require psr/http-client".');
59+
}
60+
5661
/**
5762
* An adapter to turn a Symfony HttpClientInterface into an Httplug client.
5863
*
@@ -61,7 +66,7 @@
6166
*
6267
* @author Nicolas Grekas <p@tchwork.com>
6368
*/
64-
final class HttplugClient implements HttplugInterface, HttpAsyncClient, RequestFactoryInterface, StreamFactoryInterface, UriFactoryInterface, RequestFactory, StreamFactory, UriFactory, ResetInterface
69+
final class HttplugClient implements ClientInterface, HttplugInterface, HttpAsyncClient, RequestFactoryInterface, StreamFactoryInterface, UriFactoryInterface, RequestFactory, StreamFactory, UriFactory, ResetInterface
6570
{
6671
private HttpClientInterface $client;
6772
private ResponseFactoryInterface $responseFactory;

0 commit comments

Comments
 (0)