Skip to content

Commit cb80985

Browse files
greg0ireNyholm
authored andcommitted
Remove unnecessary word (#182)
* Remove unnecessary word * Avoid long lines They produce unreadable diffs, and are hard to work with when using split windows.
1 parent e86a55a commit cb80985

File tree

1 file changed

+63
-20
lines changed

1 file changed

+63
-20
lines changed

integrations/symfony-bundle.rst

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
Symfony Bundle
22
==============
33

4-
This bundle integrate HTTPlug with the Symfony framework. The bundle helps to register services for all your clients and makes sure all the configuration is in one place. The bundle also feature a toolbar plugin with information about your requests.
4+
This bundle integrate HTTPlug with the Symfony framework. The bundle helps to
5+
register services for all your clients and makes sure all the configuration is
6+
in one place. The bundle also feature a toolbar plugin with information about
7+
your requests.
58

6-
This guide explains how to configure HTTPlug in the Symfony framework. See the :doc:`../httplug/tutorial` for examples how to use HTTPlug in general.
9+
This guide explains how to configure HTTPlug in the Symfony framework. See the
10+
:doc:`../httplug/tutorial` for examples how to use HTTPlug in general.
711

812
Installation
913
````````````
@@ -24,7 +28,8 @@ Install the HTTPlug bundle with composer and enable it in your AppKernel.php.
2428
);
2529
}
2630
27-
You will find all available configuration at the :doc:`full configuration </integrations/symfony-full-configuration>` page.
31+
You will find all available configuration at the
32+
:doc:`full configuration </integrations/symfony-full-configuration>` page.
2833

2934
Usage
3035
`````
@@ -54,9 +59,13 @@ Web Debug Toolbar
5459
:align: right
5560
:width: 260px
5661

57-
When using a client configured with ``HttplugBundle``, you will get debug information in the web debug toolbar. It will tell you how many request were made and how many of those that were successful or not. It will also show you detailed information about each request.
62+
When using a client configured with ``HttplugBundle``, you will get debug
63+
information in the web debug toolbar. It will tell you how many request were
64+
made and how many of those that were successful or not. It will also show you
65+
detailed information about each request.
5866

59-
The web profiler page will show you lots of information about the request and also how different plugins changes the message. See example screen shots below.
67+
The web profiler page will show you lots of information about the request and
68+
also how different plugins changes the message. See example screen shots below.
6069

6170
.. image:: /assets/img/symfony-profiler/dashboard.png
6271
:width: 200px
@@ -72,22 +81,29 @@ The web profiler page will show you lots of information about the request and al
7281

7382
|clearfloat|
7483

75-
The body of the HTTP messages is not captured by default because of performance reasons. Turn this on by changing the ``captured_body_length`` configuration.
84+
The body of the HTTP messages is not captured by default because of performance
85+
reasons. Turn this on by changing the ``captured_body_length`` configuration.
7686

7787
.. code-block:: yaml
7888
7989
httplug:
8090
toolbar:
8191
captured_body_length: 1000 # Capture the first 1000 chars of the HTTP body
8292
83-
The toolbar is automatically turned off when ``kernel.debug = false``. You can also disable the toolbar by configuration.
93+
The toolbar is automatically turned off when ``kernel.debug = false``. You can
94+
also disable the toolbar by configuration.
8495

8596
.. code-block:: yaml
8697
8798
httplug:
8899
toolbar: false
89100
90-
You can configure the bundle to show debug information for clients found with discovery. You may also force a specific client to be found when a third party library is using discovery. The configuration below makes sure the client with service id ``httplug.clients.my_guzzle5`` is returned when calling ``HttpClientDiscovery::find()`` . It does also make sure to show debug info for asynchronous clients.
101+
You can configure the bundle to show debug information for clients found with
102+
discovery. You may also force a specific client to be found when a third party
103+
library is using discovery. The configuration below makes sure the client with
104+
service id ``httplug.clients.my_guzzle5`` is returned when calling
105+
``HttpClientDiscovery::find()`` . It does also make sure to show debug info for
106+
asynchronous clients.
91107

92108
.. note::
93109

@@ -103,14 +119,21 @@ You can configure the bundle to show debug information for clients found with di
103119
client: 'httplug.clients.my_guzzle5'
104120
async_client: 'auto'
105121
106-
For normal clients, the auto discovery debug info is enabled by default. For async clients, debug is not enabled by default to avoid errors when using the bundle with a client that can not do async. To get debug information for async clients, set ``discovery.async_client`` to ``'auto'`` or an explicit client.
122+
For normal clients, the auto discovery debug info is enabled by default. For
123+
async clients, debug is not enabled by default to avoid errors when using the
124+
bundle with a client that can not do async. To get debug information for async
125+
clients, set ``discovery.async_client`` to ``'auto'`` or an explicit client.
107126

108-
You can turn off all interaction of the bundle with auto discovery by setting the value of ``discovery.client`` to ``false``.
127+
You can turn off all interaction of the bundle with auto discovery by setting
128+
the value of ``discovery.client`` to ``false``.
109129

110130
Discovery of Factory Classes
111131
````````````````````````````
112132

113-
If you want the bundle to automatically find usable factory classes, install and enable ``puli/symfony-bundle``. If you do not want use auto discovery, you need to specify all the factory classes for you client. The following example show how you configure factory classes using Guzzle:
133+
If you want the bundle to automatically find usable factory classes, install
134+
and enable ``puli/symfony-bundle``. If you do not want use auto discovery, you
135+
need to specify all the factory classes for you client. The following example
136+
show how you configure factory classes using Guzzle:
114137

115138
.. code-block:: yaml
116139
@@ -126,7 +149,9 @@ If you want the bundle to automatically find usable factory classes, install and
126149
Configure Clients
127150
`````````````````
128151

129-
You can configure your clients with default options. These default values will be specific to you client you are using. The clients are later registered as services.
152+
You can configure your clients with default options. These default values will
153+
be specific to you client you are using. The clients are later registered as
154+
services.
130155

131156
.. code-block:: yaml
132157
@@ -153,7 +178,10 @@ You can configure your clients with default options. These default values will b
153178
// will be the same as ``httplug.client.my_guzzle5``
154179
$httpClient = $this->container->get('httplug.client');
155180
156-
The bundle has client factory services that you can use to build your client. If you need a very custom made client you could create your own factory service implementing ``Http\HttplugBundle\ClientFactory\ClientFactory``. The built-in services are:
181+
The bundle has client factory services that you can use to build your client.
182+
If you need a very custom made client you could create your own factory service
183+
implementing ``Http\HttplugBundle\ClientFactory\ClientFactory``. The built-in
184+
services are:
157185

158186
* ``httplug.factory.curl``
159187
* ``httplug.factory.buzz``
@@ -165,9 +193,12 @@ The bundle has client factory services that you can use to build your client. If
165193
Plugins
166194
```````
167195

168-
Clients can have plugins. Generic plugins from ``php-http/plugins`` (e.g. retry or redirect) can be configured globally. You can tell the client which of those plugins to use, as well as custom plugins that you configured a service for.
196+
Clients can have plugins. Generic plugins from ``php-http/plugins`` (e.g. retry
197+
or redirect) can be configured globally. You can tell the client which of those
198+
plugins to use, as well as custom plugins that you configured a service for.
169199

170-
Additionally you can configure any of the ``php-http/plugins`` specifically on a client. For some plugins this is the only place where they can be configured.
200+
Additionally you can configure any of the ``php-http/plugins`` specifically on
201+
a client. For some plugins this is the only place where they can be configured.
171202
The order in which you specify the plugins **does** matter.
172203

173204
.. code-block:: yaml
@@ -205,7 +236,9 @@ The order in which you specify the plugins **does** matter.
205236
Authentication
206237
``````````````
207238

208-
You can configure a client with authentication. Valid authentication types are ``basic``, ``bearer``, ``service`` and ``wsse``. See more examples at the :doc:`full configuration </integrations/symfony-full-configuration>`.
239+
You can configure a client with authentication. Valid authentication types are
240+
``basic``, ``bearer``, ``service`` and ``wsse``. See more examples at the
241+
:doc:`full configuration </integrations/symfony-full-configuration>`.
209242

210243
.. code-block:: yaml
211244
@@ -226,7 +259,8 @@ You can configure a client with authentication. Valid authentication types are `
226259
Special HTTP Clients
227260
````````````````````
228261

229-
If you want to use the ``FlexibleHttpClient`` or ``HttpMethodsClient`` from the ``php-http/message`` package you may specify that on the client configuration.
262+
If you want to use the ``FlexibleHttpClient`` or ``HttpMethodsClient`` from the
263+
``php-http/message`` package you may specify that on the client configuration.
230264

231265
.. code-block:: yaml
232266
@@ -278,9 +312,18 @@ List of Services
278312
Usage for Reusable Bundles
279313
``````````````````````````
280314

281-
Rather than code against specific HTTP clients, you want to use the HTTPlug ``Client`` interface. To avoid building your own infrastructure to define services for the client, simply ``require: php-http/httplug-bundle`` in your bundles ``composer.json``. You SHOULD provide a configuration option to specify the which HTTP client service to use for each of your services. This option should default to ``httplug.client``. This way, the default case needs no additional configuration for your users, but they have the option of using specific clients with each of your services.
282-
283-
The only steps they need is ``require`` one of the adapter implementations in their projects ``composer.json`` and instantiating the ``HttplugBundle`` in their kernel.
315+
Rather than code against specific HTTP clients, you want to use the HTTPlug
316+
``Client`` interface. To avoid building your own infrastructure to define
317+
services for the client, simply ``require: php-http/httplug-bundle`` in your
318+
bundles ``composer.json``. You SHOULD provide a configuration option to specify
319+
which HTTP client service to use for each of your services. This option should
320+
default to ``httplug.client``. This way, the default case needs no additional
321+
configuration for your users, but they have the option of using specific
322+
clients with each of your services.
323+
324+
The only steps they need is ``require`` one of the adapter implementations in
325+
their projects ``composer.json`` and instantiating the ``HttplugBundle`` in
326+
their kernel.
284327

285328
.. |clearfloat| raw:: html
286329

0 commit comments

Comments
 (0)