Skip to content

Commit e7d14e4

Browse files
committed
Style fixes and docs
1 parent 0ca792c commit e7d14e4

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

CHANGELOG.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66

7+
- Add HttpClientPool client to leverage load balancing and fallback mechanism [see the documentation](http://docs.php-http.org/en/latest/components/client-common.html) for more details.
78
- `PluginClientFactory` to create `PluginClient` instances.
89
- Added new option 'delay' for `RetryPlugin`.
910
- Added new option 'decider' for `RetryPlugin`.
@@ -56,10 +57,6 @@ $plugin = new RetryPlugin(['delay' => function(RequestInterface $request, Except
5657

5758
## 1.3.0 - 2016-10-16
5859

59-
### Added
60-
61-
- Add HttpClientPool client to leverage load balancing and fallback mechanism [see the documentation](http://docs.php-http.org/en/latest/components/client-common.html) for more details
62-
6360
### Changed
6461

6562
- Fix Emulated Trait to use Http based promise which respect the HttpAsyncClient interface

src/HttpClientPool.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
*/
1414
abstract class HttpClientPool implements HttpAsyncClient, HttpClient
1515
{
16-
/** @var HttpClientPoolItem[] */
16+
/**
17+
* @var HttpClientPoolItem[]
18+
*/
1719
protected $clientPool = [];
1820

1921
/**
2022
* Add a client to the pool.
2123
*
22-
* @param HttpClient|HttpAsyncClient $client
24+
* @param HttpClient|HttpAsyncClient|HttpClientPoolItem $client
2325
*/
2426
public function addHttpClient($client)
2527
{

src/HttpClientPoolItem.php

+18-7
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,29 @@
1717
*/
1818
class HttpClientPoolItem implements HttpClient, HttpAsyncClient
1919
{
20-
/** @var int Number of request this client is currently sending */
20+
/**
21+
* @var int Number of request this client is currently sending
22+
*/
2123
private $sendingRequestCount = 0;
2224

23-
/** @var \DateTime|null Time when this client has been disabled or null if enable */
25+
/**
26+
* @var \DateTime|null Time when this client has been disabled or null if enable
27+
*/
2428
private $disabledAt;
2529

26-
/** @var int|null Number of seconds after this client is reenable, by default null: never reenable this client */
30+
/**
31+
* @var int|null Number of seconds after this client is reenable, by default null: never reenable this client
32+
*/
2733
private $reenableAfter;
2834

29-
/** @var FlexibleHttpClient A http client responding to async and sync request */
35+
/**
36+
* @var FlexibleHttpClient A http client responding to async and sync request
37+
*/
3038
private $client;
3139

3240
/**
33-
* {@inheritdoc}
34-
*
35-
* @param null|int $reenableAfter Number of seconds after this client is reenable
41+
* @param HttpClient|HttpAsyncClient $client
42+
* @param null|int $reenableAfter Number of seconds after this client is reenable
3643
*/
3744
public function __construct($client, $reenableAfter = null)
3845
{
@@ -91,6 +98,8 @@ public function sendAsyncRequest(RequestInterface $request)
9198
*
9299
* Will also reactivate this client if possible
93100
*
101+
* @internal
102+
*
94103
* @return bool
95104
*/
96105
public function isDisabled()
@@ -116,6 +125,8 @@ public function isDisabled()
116125
/**
117126
* Get current number of request that is send by the underlying http client.
118127
*
128+
* @internal
129+
*
119130
* @return int
120131
*/
121132
public function getSendingRequestCount()

0 commit comments

Comments
 (0)