Skip to content

Commit d412d4b

Browse files
committed
remove http client interface
1 parent 7b8e321 commit d412d4b

File tree

6 files changed

+9
-17
lines changed

6 files changed

+9
-17
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
"php-http/message": "^1.5",
4444
"php-http/discovery": "^1.2.1",
4545
"symfony/http-foundation": "^2.1|^3|^4",
46-
"moneyphp/money": "^3.1",
47-
"psr/http-client": "^0.1.0"
46+
"moneyphp/money": "^3.1"
4847
},
4948
"require-dev": {
5049
"omnipay/tests": "^3",

src/Common/Http/Client.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ public function __construct($httpClient = null, RequestFactory $requestFactory =
4141
* @param array $headers
4242
* @param string|array|resource|StreamInterface|null $body
4343
* @param string $protocolVersion
44-
*
45-
* @throws \Psr\Http\Client\Exception\NetworkException
46-
* @throws \Psr\Http\Client\Exception\RequestException
47-
*
4844
* @return ResponseInterface
45+
* @throws \Http\Client\Exception
4946
*/
5047
public function request(
5148
string $method,
@@ -62,8 +59,7 @@ public function request(
6259
/**
6360
* @param RequestInterface $request
6461
* @return ResponseInterface
65-
* @throws \Psr\Http\Client\Exception\NetworkException
66-
* @throws \Psr\Http\Client\Exception\RequestException
62+
* @throws \Http\Client\Exception
6763
*/
6864
private function sendRequest(RequestInterface $request)
6965
{

src/Common/Http/ClientInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Omnipay\Common\Http;
44

5-
use Psr\Http\Client\Exception\NetworkException;
6-
use Psr\Http\Client\Exception\RequestException;
5+
use Omnipay\Common\Http\Exception\NetworkException;
6+
use Omnipay\Common\Http\Exception\RequestException;
77
use Psr\Http\Message\ResponseInterface;
88
use Psr\Http\Message\StreamInterface;
99
use Psr\Http\Message\UriInterface;

src/Common/Http/Exception/NetworkException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
namespace Omnipay\Common\Http\Exception;
44

55
use Omnipay\Common\Http\Exception;
6-
use Psr\Http\Client\Exception\NetworkException as PsrNetworkException;
76

8-
class NetworkException extends Exception implements PsrNetworkException
7+
class NetworkException extends Exception
98
{
109
}

src/Common/Http/Exception/RequestException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
namespace Omnipay\Common\Http\Exception;
44

55
use Omnipay\Common\Http\Exception;
6-
use Psr\Http\Client\Exception\RequestException as PsrRequestException;
76

8-
class RequestException extends Exception implements PsrRequestException
7+
class RequestException extends Exception
98
{
109
}

tests/Omnipay/Common/Http/ClientTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Http\Client\HttpClient;
1010
use Http\Message\RequestFactory;
1111
use Omnipay\Tests\TestCase;
12-
use Psr\Http\Client\Exception\RequestException;
1312

1413
class ClientTest extends TestCase
1514
{
@@ -68,7 +67,7 @@ public function testSendException()
6867
->with($request)
6968
->andThrow(new \Exception('Something went wrong'));
7069

71-
$this->expectException(RequestException::class);
70+
$this->expectException(\Omnipay\Common\Http\Exception\RequestException::class);
7271
$this->expectExceptionMessage('Something went wrong');
7372

7473
$client->request('GET', '/path');
@@ -95,7 +94,7 @@ public function testSendNetworkException()
9594
->with($request)
9695
->andThrow(new NetworkException('Something went wrong', $request));
9796

98-
$this->expectException(\Psr\Http\Client\Exception\NetworkException::class);
97+
$this->expectException(\Omnipay\Common\Http\Exception\NetworkException::class);
9998
$this->expectExceptionMessage('Something went wrong');
10099

101100
$client->request('GET', '/path');

0 commit comments

Comments
 (0)