Skip to content

Commit 2f2b210

Browse files
committed
Fix typos
1 parent 25fa2b5 commit 2f2b210

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/plugins.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Plugin System
22

3-
The plugin system allow to manipulate requests and responses inside a `HttpClient`.
3+
The plugin system allow to manipulate requests and responses inside an `HttpClient`.
44

5-
By using the `Http\Client\Plugin\PluginClient` you can inject a `HttpClient` or a `HttpAsyncClient`, and an array
5+
By using the `Http\Client\Plugin\PluginClient` you can inject an `HttpClient` or an `HttpAsyncClient`, and an array
66
of plugins implementing the `Http\Client\Plugin\Plugin` interface.
77

88
Each plugin can modify the `RequestInterface` sent or the `ResponseInterface` received. It can also change the behavior of a call
@@ -52,7 +52,7 @@ $response = $pluginClient->sendRequest($request);
5252
$promise = $pluginClient->sendAsyncRequest($request);
5353
```
5454

55-
Read the [tutorial](tutorial.md) to know more about `HttpClient` and `HttpAsyncClient`
55+
GO to the [tutorial](tutorial.md) to read more about using `HttpClient` and `HttpAsyncClient`
5656

5757
## Available plugins
5858

@@ -102,10 +102,10 @@ Response <--- PluginClient <--- RetryPlugin <--- RedirectPlugin <--- HttpClient
102102
In order to have correct behavior over the global process, you need to understand well each plugin used,
103103
and manage a correct order when passing the array to the `PluginClient`
104104

105-
`RetryPlugin` will be best at then for example if you want to optimize the retry process, but also it can be good
106-
to have it in the first plugin, if one is inconsistent and may need a retry.
105+
`RetryPlugin` will be best at the end to optimize the retry process, but it can also be good
106+
to have it as the first plugin, if one in the chain is inconsistent and may need a retry.
107107

108-
Our recommendation, which apply to most of the use case, is to organize your plugins with the following rule:
108+
Our recommendation, which apply to most of use cases, is to organize your plugins with following rules:
109109

110110
1. Plugins that modify the request should be at the beginning (like the `AuthenticationPlugin` or the `CookiePlugin`)
111111
2. Plugins which intervene in the workflow should be in the "middle" (like the `RetryPlugin` or the `RedirectPlugin`)
@@ -180,7 +180,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
180180
In this example the condition is not superfluous, you need to have some way to not calling the $first callable each time or
181181
you will end up with a infinite execution loop.
182182

183-
The `$next` and `$first` callable will return a `Promise`, you can manipulate the `ResponseInterface` or the `Exception`
183+
The `$next` and `$first` callable will return a `Promise`. You can manipulate the `ResponseInterface` or the `Exception`
184184
by using the `then` method of the promise.
185185

186186
```
@@ -199,4 +199,4 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
199199
```
200200

201201
Anyway it is always a good practice to read existing implementation inside the [plugin repository](https://github.com/php-http/plugins) to better understand the whole
202-
process;
202+
process.

0 commit comments

Comments
 (0)