Skip to content

Commit e54671e

Browse files
nicolas-grekasNyholm
authored andcommitted
Add Symfony Client entry (#272)
1 parent 3ef939e commit e54671e

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

clients.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface and forwarding the calls to an HTTP client not implementing the interf
1616
clients/curl-client
1717
clients/socket-client
1818
clients/mock-client
19+
clients/symfony-client
1920
clients/artax-adapter
2021
clients/buzz-adapter
2122
clients/cakephp-adapter
@@ -31,6 +32,7 @@ interface and forwarding the calls to an HTTP client not implementing the interf
3132
"``php-http/curl-client``", "Client", ":doc:`Docs </clients/curl-client>`, `Repo <https://github.com/php-http/curl-client>`__", "|curl_version| |curl_downloads| "
3233
"``php-http/socket-client``", "Client", ":doc:`Docs </clients/socket-client>`, `Repo <https://github.com/php-http/socket-client>`__", "|socket_version| |socket_downloads| "
3334
"``php-http/mock-client``", "Client", ":doc:`Docs </clients/mock-client>`, `Repo <https://github.com/php-http/mock-client>`__", "|mock_version| |mock_downloads| "
35+
"``symfony/http-client``", "Client", ":doc:`Docs </clients/symfony-client>`, `Repo <https://github.com/symfony/http-client>`__", "|symfony_version| |symfony_downloads| "
3436
"``php-http/artax-adapter``", "Adapter", ":doc:`Docs </clients/artax-adapter>`, `Repo <https://github.com/php-http/artax-adapter>`__", "|artax_version| |artax_downloads| "
3537
"``php-http/buzz-adapter``", "Adapter", ":doc:`Docs </clients/buzz-adapter>`, `Repo <https://github.com/php-http/buzz-adapter>`__", "|buzz_version| |buzz_downloads| "
3638
"``php-http/cakephp-adapter``", "Adapter", ":doc:`Docs </clients/cakephp-adapter>`, `Repo <https://github.com/php-http/cakephp-adapter>`__", "|cakephp_version| |cakephp_downloads| "
@@ -76,6 +78,13 @@ HTTPlug use the ``provide`` section to tell composer that they do provide the cl
7678
:target: https://github.com/php-http/mock-client/releases
7779
:alt: Latest Version
7880

81+
.. |symfony_downloads| image:: https://img.shields.io/packagist/dt/symfony/http-client.svg?style=flat-square
82+
:target: https://packagist.org/packages/symfony/http-client
83+
:alt: Total Downloads
84+
.. |symfony_version| image:: https://img.shields.io/github/v/tag/symfony/http-client.svg?style=flat-square
85+
:target: https://github.com/symfony/http-client/releases
86+
:alt: Latest Version
87+
7988
.. |artax_downloads| image:: https://img.shields.io/packagist/dt/php-http/artax-adapter.svg?style=flat-square
8089
:target: https://packagist.org/packages/php-http/artax-adapter
8190
:alt: Total Downloads

clients/symfony-client.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Symfony Client
2+
==============
3+
4+
An HTTPlug implementation from the `Symfony HttpClient`_.
5+
6+
Installation
7+
------------
8+
9+
To install the Symfony client, run:
10+
11+
.. code-block:: bash
12+
13+
$ composer require symfony/http-client
14+
15+
This client does not come with a PSR-7 implementation out of the box, so you have
16+
to install one as well. `Nyholm PSR-7`_ is supported natively:
17+
18+
.. code-block:: bash
19+
20+
$ composer require nyholm/psr7
21+
22+
.. include:: includes/install-discovery.inc
23+
24+
Usage
25+
-----
26+
27+
use Symfony\Component\HttpClient\HttplugClient;
28+
29+
$symfonyClient = new HttplugClient();
30+
31+
.. note::
32+
33+
Check the official `Symfony HttpClient`_ documentation for more details.
34+
35+
.. _Symfony HttpClient: https://symfony.com/doc/current/components/http_client.html#httplug
36+
37+
.. _Nyholm PSR-7: https://github.com/Nyholm/psr7/

discovery.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Strategies
3535

3636
The package supports multiple discovery strategies and comes with two out-of-the-box:
3737

38-
- A built-in strategy supporting the HTTPlug adapters, clients and factories (including Guzzle, Diactoros and Slim Framework)
38+
- A built-in strategy supporting the HTTPlug adapters, clients and factories (including Symfony, Guzzle, Diactoros and Slim Framework)
3939
- A strategy supporting the beta version of `Puli`_
4040

4141
Strategies provide candidates of a type which gets evaluated by the discovery service.

0 commit comments

Comments
 (0)