Skip to content

Commit d99e7aa

Browse files
committed
Fix all remaining client signatures
1 parent 5dd4d9f commit d99e7aa

9 files changed

+16
-12
lines changed

spec/HttpClientPool/LeastUsedClientPoolSpec.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ public function it_reenable_client(HttpClient $client, RequestInterface $request
7272

7373
public function it_uses_the_lowest_request_client(HttpClientPoolItem $client1, HttpClientPoolItem $client2, RequestInterface $request, ResponseInterface $response)
7474
{
75-
if (extension_loaded('xdebug')) {
76-
throw new SkippingException('This test fail when xdebug is enable on PHP < 7');
77-
}
78-
7975
$this->addHttpClient($client1);
8076
$this->addHttpClient($client2);
8177

src/BatchClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Http\Client\HttpClient;
77
use Http\Client\Common\Exception\BatchException;
88
use Psr\Http\Message\RequestInterface;
9+
use Psr\Http\Message\ResponseInterface;
910

1011
/**
1112
* BatchClient allow to sends multiple request and retrieve a Batch Result.
@@ -32,7 +33,7 @@ public function __construct(HttpClient $client)
3233
/**
3334
* {@inheritdoc}
3435
*/
35-
public function sendRequest(RequestInterface $request)
36+
public function sendRequest(RequestInterface $request): ResponseInterface
3637
{
3738
return $this->client->sendRequest($request);
3839
}

src/HttpAsyncClientEmulator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Http\Client\Exception;
66
use Http\Client\Promise;
77
use Psr\Http\Message\RequestInterface;
8+
use Psr\Http\Message\ResponseInterface;
89

910
/**
1011
* Emulates an HTTP Async Client in an HTTP Client.
@@ -18,7 +19,7 @@ trait HttpAsyncClientEmulator
1819
*
1920
* @see HttpClient::sendRequest
2021
*/
21-
abstract public function sendRequest(RequestInterface $request);
22+
abstract public function sendRequest(RequestInterface $request): ResponseInterface;
2223

2324
/**
2425
* {@inheritdoc}

src/HttpClientDecorator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Http\Client\HttpClient;
66
use Psr\Http\Message\RequestInterface;
7+
use Psr\Http\Message\ResponseInterface;
78

89
/**
910
* Decorates an HTTP Client.
@@ -22,7 +23,7 @@ trait HttpClientDecorator
2223
*
2324
* @see HttpClient::sendRequest
2425
*/
25-
public function sendRequest(RequestInterface $request)
26+
public function sendRequest(RequestInterface $request): ResponseInterface
2627
{
2728
return $this->httpClient->sendRequest($request);
2829
}

src/HttpClientEmulator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Http\Client\Common;
44

55
use Psr\Http\Message\RequestInterface;
6+
use Psr\Http\Message\ResponseInterface;
67

78
/**
89
* Emulates an HTTP Client in an HTTP Async Client.
@@ -16,7 +17,7 @@ trait HttpClientEmulator
1617
*
1718
* @see HttpClient::sendRequest
1819
*/
19-
public function sendRequest(RequestInterface $request)
20+
public function sendRequest(RequestInterface $request): ResponseInterface
2021
{
2122
$promise = $this->sendAsyncRequest($request);
2223

src/HttpClientPool.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Http\Client\HttpAsyncClient;
77
use Http\Client\HttpClient;
88
use Psr\Http\Message\RequestInterface;
9+
use Psr\Http\Message\ResponseInterface;
910

1011
/**
1112
* A http client pool allows to send requests on a pool of different http client using a specific strategy (least used,
@@ -52,7 +53,7 @@ public function sendAsyncRequest(RequestInterface $request)
5253
/**
5354
* {@inheritdoc}
5455
*/
55-
public function sendRequest(RequestInterface $request)
56+
public function sendRequest(RequestInterface $request): ResponseInterface
5657
{
5758
return $this->chooseHttpClient()->sendRequest($request);
5859
}

src/HttpClientPoolItem.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Http\Client\HttpClient;
77
use Psr\Http\Message\RequestInterface;
88
use Http\Client\Exception;
9+
use Psr\Http\Message\ResponseInterface;
910

1011
/**
1112
* A HttpClientPoolItem represent a HttpClient inside a Pool.
@@ -50,7 +51,7 @@ public function __construct($client, $reenableAfter = null)
5051
/**
5152
* {@inheritdoc}
5253
*/
53-
public function sendRequest(RequestInterface $request)
54+
public function sendRequest(RequestInterface $request): ResponseInterface
5455
{
5556
if ($this->isDisabled()) {
5657
throw new Exception\RequestException('Cannot send the request as this client has been disabled', $request);

src/HttpClientRouter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Http\Client\HttpClient;
88
use Http\Message\RequestMatcher;
99
use Psr\Http\Message\RequestInterface;
10+
use Psr\Http\Message\ResponseInterface;
1011

1112
/**
1213
* Route a request to a specific client in the stack based using a RequestMatcher.
@@ -23,7 +24,7 @@ final class HttpClientRouter implements HttpClient, HttpAsyncClient
2324
/**
2425
* {@inheritdoc}
2526
*/
26-
public function sendRequest(RequestInterface $request)
27+
public function sendRequest(RequestInterface $request): ResponseInterface
2728
{
2829
$client = $this->chooseHttpClient($request);
2930

src/PluginClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Http\Client\Promise\HttpFulfilledPromise;
1010
use Http\Client\Promise\HttpRejectedPromise;
1111
use Psr\Http\Message\RequestInterface;
12+
use Psr\Http\Message\ResponseInterface;
1213
use Symfony\Component\OptionsResolver\OptionsResolver;
1314

1415
/**
@@ -67,7 +68,7 @@ public function __construct($client, array $plugins = [], array $options = [])
6768
/**
6869
* {@inheritdoc}
6970
*/
70-
public function sendRequest(RequestInterface $request)
71+
public function sendRequest(RequestInterface $request): ResponseInterface
7172
{
7273
// If we don't have an http client, use the async call
7374
if (!($this->client instanceof HttpClient)) {

0 commit comments

Comments
 (0)