8000 minor #50163 [HttpClient] Add PSR-18 to HttplugClient since HTTPlug i… · symfony/symfony@8b6edd9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b6edd9

Browse files
committed
minor #50163 [HttpClient] Add PSR-18 to HttplugClient since HTTPlug is deprecated (nicolas-grekas)
This PR was merged into the 6.3 branch. Discussion ---------- [HttpClient] Add PSR-18 to HttplugClient since HTTPlug is deprecated | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Relates to php-http/httplug#171 Commits ------- ab9cefc [HttpClient] Add PSR-18 to HttplugClient since HTTPlug is deprecated
2 parents 32c5fb0 + ab9cefc commit 8b6edd9

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)
0