Skip to content

Commit

Permalink
use use statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Dec 30, 2018
1 parent 2a243f5 commit 15e199f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Collector/Formatter.php
Expand Up @@ -7,6 +7,8 @@
use Http\Client\Exception\TransferException;
use Http\Message\Formatter as MessageFormatter;
use Http\Message\Formatter\CurlCommandFormatter;
use Psr\Http\Client\NetworkExceptionInterface;
use Psr\Http\Client\RequestExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

Expand Down Expand Up @@ -49,11 +51,11 @@ public function __construct(MessageFormatter $formatter, CurlCommandFormatter $c
*/
public function formatException(Exception $exception)
{
if ($exception instanceof HttpException || $exception instanceof \Psr\Http\Client\RequestExceptionInterface) {
if ($exception instanceof HttpException || $exception instanceof RequestExceptionInterface) {
return $this->formatter->formatResponse($exception->getResponse());
}

if ($exception instanceof TransferException || $exception instanceof \Psr\Http\Client\NetworkExceptionInterface) {
if ($exception instanceof TransferException || $exception instanceof NetworkExceptionInterface) {
return sprintf('Transfer error: %s', $exception->getMessage());
}

Expand Down
3 changes: 2 additions & 1 deletion Collector/ProfileClient.php
Expand Up @@ -8,6 +8,7 @@
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Client\RequestExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\Stopwatch\Stopwatch;
Expand Down Expand Up @@ -182,7 +183,7 @@ private function collectResponseInformations(ResponseInterface $response, Stopwa
*/
private function collectExceptionInformations(\Exception $exception, StopwatchEvent $event, Stack $stack)
{
if ($exception instanceof HttpException || $exception instanceof \Psr\Http\Client\RequestExceptionInterface) {
if ($exception instanceof HttpException || $exception instanceof RequestExceptionInterface) {
$this->collectResponseInformations($exception->getResponse(), $event, $stack);
}

Expand Down

0 comments on commit 15e199f

Please sign in to comment.