@@ -1619,47 +1619,10 @@ The `HTTPlug`_ v1 specification was published before PSR-18 and is superseded by
1619
1619
it. As such, you should not use it in newly written code. The component is still
1620
1620
interoperable with libraries that require it thanks to the
1621
1621
:class: `Symfony\\ Component\\ HttpClient\\ HttplugClient ` class. Similarly to
1622
- :class: `Symfony\\ Component\\ HttpClient\\ Psr18Client ` implementing relevant parts of PSR-17,
1623
- ``HttplugClient `` also implements the factory methods defined in the related
1624
- ``php-http/message-factory `` package.
1622
+ :class: `Symfony\\ Component\\ HttpClient\\ Psr18Client `, ``HttplugClient `` also
1623
+ implements relevant parts of PSR-17.
1625
1624
1626
- .. code-block :: terminal
1627
-
1628
- # Let's suppose php-http/httplug is already required by the lib you want to use
1629
-
1630
- # installs an efficient implementation of response and stream factories
1631
- # with autowiring aliases provided by Symfony Flex
1632
- $ composer require nyholm/psr7
1633
-
1634
- # alternatively, install the php-http/discovery package to auto-discover
1635
- # any already installed implementations from common vendors:
1636
- # composer require php-http/discovery
1637
-
1638
- Let's say you want to instantiate a class with the following constructor,
1639
- that requires HTTPlug dependencies::
1640
-
1641
- use Http\Client\HttpClient;
1642
- use Http\Message\RequestFactory;
1643
- use Http\Message\StreamFactory;
1644
-
1645
- class SomeSdk
1646
- {
1647
- public function __construct(
1648
- HttpClient $httpClient,
1649
- RequestFactory $requestFactory,
1650
- StreamFactory $streamFactory
1651
- )
1652
- // [...]
1653
- }
1654
-
1655
- Because ``HttplugClient `` implements the three interfaces, you can use it this way::
1656
-
1657
- use Symfony\Component\HttpClient\HttplugClient;
1658
-
1659
- $httpClient = new HttplugClient();
1660
- $apiClient = new SomeSdk($httpClient, $httpClient, $httpClient);
1661
-
1662
- If you'd like to work with promises, ``HttplugClient `` also implements the
1625
+ If you'd like to work with promises, ``HttplugClient `` implements the
1663
1626
``HttpAsyncClient `` interface. To use it, you need to install the
1664
1627
``guzzlehttp/promises `` package:
1665
1628
0 commit comments