diff --git a/src/Common/Http/Client.php b/src/Common/Http/Client.php index 3dc947a..590995e 100644 --- a/src/Common/Http/Client.php +++ b/src/Common/Http/Client.php @@ -36,22 +36,14 @@ public function __construct($httpClient = null, RequestFactoryInterface $request } /** - * @param $method - * @param $uri - * @param array $headers - * @param string|array|resource|StreamInterface|null $body - * @param string $protocolVersion + * @param string $method + * @param string|UriInterface $uri * @return ResponseInterface * @throws \Http\Client\Exception */ public function request( - $method, - $uri, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ) { - $request = $this->requestFactory->createRequest($method, $uri, $headers, $body, $protocolVersion); + $method, $uri) { + $request = $this->requestFactory->createRequest($method, $uri); return $this->sendRequest($request); } diff --git a/src/Common/Http/ClientInterface.php b/src/Common/Http/ClientInterface.php index 7359395..3f5ae9d 100644 --- a/src/Common/Http/ClientInterface.php +++ b/src/Common/Http/ClientInterface.php @@ -15,9 +15,6 @@ interface ClientInterface * * @param string $method * @param string|UriInterface $uri - * @param array $headers - * @param resource|string|StreamInterface|null $body - * @param string $protocolVersion * * @throws RequestException when the HTTP client is passed a request that is invalid and cannot be sent. * @throws NetworkException if there is an error with the network or the remote server cannot be reached. @@ -26,9 +23,6 @@ interface ClientInterface */ public function request( $method, - $uri, - array $headers = [], - $body = null, - $protocolVersion = '1.1' + $uri ); } diff --git a/tests/Common/Http/ClientTest.php b/tests/Common/Http/ClientTest.php index 74414ff..c1dbace 100644 --- a/tests/Common/Http/ClientTest.php +++ b/tests/Common/Http/ClientTest.php @@ -26,9 +26,6 @@ public function testSend() $mockFactory->shouldReceive('createRequest')->withArgs([ 'GET', '/path', - [], - null, - '1.1', ])->andReturn($request); $mockClient->shouldReceive('sendRequest') @@ -52,9 +49,6 @@ public function testSendException() $mockFactory->shouldReceive('createRequest')->withArgs([ 'GET', '/path', - [], - null, - '1.1', ])->andReturn($request); $mockClient->shouldReceive('sendRequest') @@ -79,9 +73,6 @@ public function testSendNetworkException() $mockFactory->shouldReceive('createRequest')->withArgs([ 'GET', '/path', - [], - null, - '1.1', ])->andReturn($request); $mockClient->shouldReceive('sendRequest') @@ -106,9 +97,6 @@ public function testSendExceptionGetRequest() $mockFactory->shouldReceive('createRequest')->withArgs([ 'GET', '/path', - [], - null, - '1.1', ])->andReturn($request); $exception = new \Exception('Something went wrong');