@@ -63,7 +63,7 @@ |
||
63 | 63 | $request = $request->withAddedHeader('Cookie', \implode('; ', array_unique($cookies))); |
64 | 64 | } |
65 | 65 | |
66 | - return $next($request)->then(function (ResponseInterface $response) use ($request) { |
|
66 | + return $next($request)->then(function(ResponseInterface $response) use ($request) { |
|
67 | 67 | if ($response->hasHeader('Set-Cookie')) { |
68 | 68 | $setCookies = $response->getHeader('Set-Cookie'); |
69 | 69 |
@@ -36,11 +36,11 @@ |
||
36 | 36 | { |
37 | 37 | $journal = $this->journal; |
38 | 38 | |
39 | - return $next($request)->then(function (ResponseInterface $response) use ($request, $journal) { |
|
39 | + return $next($request)->then(function(ResponseInterface $response) use ($request, $journal) { |
|
40 | 40 | $journal->addSuccess($request, $response); |
41 | 41 | |
42 | 42 | return $response; |
43 | - }, function (ClientExceptionInterface $exception) use ($request, $journal) { |
|
43 | + }, function(ClientExceptionInterface $exception) use ($request, $journal) { |
|
44 | 44 | $journal->addFailure($request, $exception); |
45 | 45 | |
46 | 46 | throw $exception; |
@@ -69,8 +69,8 @@ |
||
69 | 69 | |
70 | 70 | if (\substr($path, 0, \strlen($prepend)) !== $prepend) { |
71 | 71 | $request = $request->withUri($request->getUri() |
72 | - ->withPath($prepend.$path) |
|
73 | - ); |
|
72 | + ->withPath($prepend.$path) |
|
73 | + ); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $next($request); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | { |
59 | 59 | $deferred = new self($this->waitCallback); |
60 | 60 | |
61 | - $this->onFulfilledCallbacks[] = function (ResponseInterface $response) use ($onFulfilled, $deferred) { |
|
61 | + $this->onFulfilledCallbacks[] = function(ResponseInterface $response) use ($onFulfilled, $deferred) { |
|
62 | 62 | try { |
63 | 63 | if (null !== $onFulfilled) { |
64 | 64 | $response = $onFulfilled($response); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | }; |
71 | 71 | |
72 | - $this->onRejectedCallbacks[] = function (ClientExceptionInterface $exception) use ($onRejected, $deferred) { |
|
72 | + $this->onRejectedCallbacks[] = function(ClientExceptionInterface $exception) use ($onRejected, $deferred) { |
|
73 | 73 | try { |
74 | 74 | if (null !== $onRejected) { |
75 | 75 | $response = $onRejected($exception); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $reversedPlugins = array_reverse($this->plugins); |
45 | 45 | |
46 | 46 | foreach ($reversedPlugins as $plugin) { |
47 | - $lastCallable = function (RequestInterface $request) use ($plugin, $lastCallable) { |
|
47 | + $lastCallable = function(RequestInterface $request) use ($plugin, $lastCallable) { |
|
48 | 48 | return $plugin->handleRequest($request, $lastCallable, $this); |
49 | 49 | }; |
50 | 50 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | // Else we want to use the synchronous call of the underlying client, |
81 | 81 | // and not the async one in the case we have both an async and sync call |
82 | - $pluginChain = $this->createPluginChain($this->plugins, function (RequestInterface $request) { |
|
82 | + $pluginChain = $this->createPluginChain($this->plugins, function(RequestInterface $request) { |
|
83 | 83 | try { |
84 | 84 | return new HttpFulfilledPromise($this->client->sendRequest($request)); |
85 | 85 | } catch (HttplugException $exception) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function sendAsyncRequest(RequestInterface $request) |
97 | 97 | { |
98 | - $pluginChain = $this->createPluginChain($this->plugins, function (RequestInterface $request) { |
|
98 | + $pluginChain = $this->createPluginChain($this->plugins, function(RequestInterface $request) { |
|
99 | 99 | return $this->client->sendAsyncRequest($request); |
100 | 100 | }); |
101 | 101 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | protected function chooseHttpClient(): HttpClientPoolItem |
20 | 20 | { |
21 | - $clientPool = \array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { |
|
21 | + $clientPool = \array_filter($this->clientPool, function(HttpClientPoolItem $clientPoolItem) { |
|
22 | 22 | return !$clientPoolItem->isDisabled(); |
23 | 23 | }); |
24 | 24 |
@@ -103,11 +103,11 @@ |
||
103 | 103 | |
104 | 104 | $this->incrementRequestCount(); |
105 | 105 | |
106 | - return $this->client->sendAsyncRequest($request)->then(function ($response) { |
|
106 | + return $this->client->sendAsyncRequest($request)->then(function($response) { |
|
107 | 107 | $this->decrementRequestCount(); |
108 | 108 | |
109 | 109 | return $response; |
110 | - }, function ($exception) { |
|
110 | + }, function($exception) { |
|
111 | 111 | $this->disable(); |
112 | 112 | $this->decrementRequestCount(); |
113 | 113 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | protected function chooseHttpClient(): HttpClientPoolItem |
22 | 22 | { |
23 | - $clientPool = \array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { |
|
23 | + $clientPool = \array_filter($this->clientPool, function(HttpClientPoolItem $clientPoolItem) { |
|
24 | 24 | return !$clientPoolItem->isDisabled(); |
25 | 25 | }); |
26 | 26 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | throw new HttpClientNotFoundException('Cannot choose a http client as there is no one present in the pool'); |
29 | 29 | } |
30 | 30 | |
31 | - usort($clientPool, function (HttpClientPoolItem $clientA, HttpClientPoolItem $clientB) { |
|
31 | + usort($clientPool, function(HttpClientPoolItem $clientA, HttpClientPoolItem $clientB) { |
|
32 | 32 | if ($clientA->getSendingRequestCount() === $clientB->getSendingRequestCount()) { |
33 | 33 | return 0; |
34 | 34 | } |