Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 4c53915

Browse files
committed
Updated doc block
1 parent d7c08b6 commit 4c53915

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/Guzzle6HttpAdapter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use GuzzleHttp\Client;
1414
use GuzzleHttp\ClientInterface;
1515
use GuzzleHttp\Exception as GuzzleExceptions;
16+
use Http\Client\Exception;
1617
use Http\Client\Exception\HttpException;
1718
use Http\Client\Exception\NetworkException;
1819
use Http\Client\Exception\RequestException;
@@ -55,9 +56,9 @@ public function sendRequest(RequestInterface $request)
5556
/**
5657
* Converts a Guzzle exception into an Httplug exception.
5758
*
58-
* @param GuzzleExceptions\TransferException $exception
59+
* @param GuzzleExceptions\GuzzleException $exception
5960
*
60-
* @return RequestException
61+
* @return Exception
6162
*/
6263
private function handleException(GuzzleExceptions\GuzzleException $exception)
6364
{

tests/Guzzle6HttpAdapterExceptionTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Http\Adapter\Tests;
1313

14-
use GuzzleHttp\Exception as Guzzle;
14+
use GuzzleHttp\Exception as GuzzleExceptions;
1515
use Http\Adapter\Guzzle6HttpAdapter;
1616

1717
/**
@@ -28,40 +28,40 @@ public function testGetException()
2828
$method = new \ReflectionMethod('Http\Adapter\Guzzle6HttpAdapter', 'handleException');
2929
$method->setAccessible(true);
3030

31-
$outputException = $method->invoke($adapter, new Guzzle\ConnectException('foo', $request));
31+
$outputException = $method->invoke($adapter, new GuzzleExceptions\ConnectException('foo', $request));
3232
$this->assertInstanceOf('Http\Client\Exception\NetworkException', $outputException, "Guzzle's ConnectException should be converted to a NetworkException");
3333

34-
$outputException = $method->invoke($adapter, new Guzzle\TooManyRedirectsException('foo', $request));
34+
$outputException = $method->invoke($adapter, new GuzzleExceptions\TooManyRedirectsException('foo', $request));
3535
$this->assertInstanceOf('Http\Client\Exception\NetworkException', $outputException, "Guzzle's TooManyRedirectsException should be converted to a NetworkException");
3636

37-
$outputException = $method->invoke($adapter, new Guzzle\RequestException('foo', $request, $response));
37+
$outputException = $method->invoke($adapter, new GuzzleExceptions\RequestException('foo', $request, $response));
3838
$this->assertInstanceOf('Http\Client\Exception\HttpException', $outputException, "Guzzle's RequestException should be converted to a HttpException");
3939

40-
$outputException = $method->invoke($adapter, new Guzzle\BadResponseException('foo', $request, $response));
40+
$outputException = $method->invoke($adapter, new GuzzleExceptions\BadResponseException('foo', $request, $response));
4141
$this->assertInstanceOf('Http\Client\Exception\HttpException', $outputException, "Guzzle's BadResponseException should be converted to a HttpException");
4242

43-
$outputException = $method->invoke($adapter, new Guzzle\ClientException('foo', $request, $response));
43+
$outputException = $method->invoke($adapter, new GuzzleExceptions\ClientException('foo', $request, $response));
4444
$this->assertInstanceOf('Http\Client\Exception\HttpException', $outputException, "Guzzle's ClientException should be converted to a HttpException");
4545

46-
$outputException = $method->invoke($adapter, new Guzzle\ServerException('foo', $request, $response));
46+
$outputException = $method->invoke($adapter, new GuzzleExceptions\ServerException('foo', $request, $response));
4747
$this->assertInstanceOf('Http\Client\Exception\HttpException', $outputException, "Guzzle's ServerException should be converted to a HttpException");
4848

49-
$outputException = $method->invoke($adapter, new Guzzle\TransferException('foo'));
49+
$outputException = $method->invoke($adapter, new GuzzleExceptions\TransferException('foo'));
5050
$this->assertInstanceOf('Http\Client\Exception\TransferException', $outputException, "Guzzle's TransferException should be converted to a TransferException");
5151

5252
/*
5353
* Test RequestException without response
5454
*/
55-
$outputException = $method->invoke($adapter, new Guzzle\RequestException('foo', $request));
55+
$outputException = $method->invoke($adapter, new GuzzleExceptions\RequestException('foo', $request));
5656
$this->assertInstanceOf('Http\Client\Exception\RequestException', $outputException, "Guzzle's RequestException with no response should be converted to a RequestException");
5757

58-
$outputException = $method->invoke($adapter, new Guzzle\BadResponseException('foo', $request));
58+
$outputException = $method->invoke($adapter, new GuzzleExceptions\BadResponseException('foo', $request));
5959
$this->assertInstanceOf('Http\Client\Exception\RequestException', $outputException, "Guzzle's BadResponseException with no response should be converted to a RequestException");
6060

61-
$outputException = $method->invoke($adapter, new Guzzle\ClientException('foo', $request));
61+
$outputException = $method->invoke($adapter, new GuzzleExceptions\ClientException('foo', $request));
6262
$this->assertInstanceOf('Http\Client\Exception\RequestException', $outputException, "Guzzle's ClientException with no response should be converted to a RequestException");
6363

64-
$outputException = $method->invoke($adapter, new Guzzle\ServerException('foo', $request));
64+
$outputException = $method->invoke($adapter, new GuzzleExceptions\ServerException('foo', $request));
6565
$this->assertInstanceOf('Http\Client\Exception\RequestException', $outputException, "Guzzle's ServerException with no response should be converted to a RequestException");
6666
}
6767
}

0 commit comments

Comments
 (0)