Skip to content

Commit

Permalink
Implement http exception to be compatible with HTTP mock client
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Sep 9, 2024
1 parent ee9ca4b commit 2a61c3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Test/UseHttpFactories.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Phpro\HttpTools\Test;

use Http\Client\Exception;
use Http\Discovery\Psr17FactoryDiscovery;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\RequestInterface;
Expand All @@ -28,9 +29,9 @@ private function createStream(string $content): StreamInterface
return Psr17FactoryDiscovery::findStreamFactory()->createStream($content);
}

private function createEmptyHttpClientException(string $message): ClientExceptionInterface
private function createEmptyHttpClientException(string $message): ClientExceptionInterface&Exception
{
return new class($message) extends RuntimeException implements ClientExceptionInterface {
return new class($message) extends RuntimeException implements ClientExceptionInterface, Exception {
};
}
}

0 comments on commit 2a61c3f

Please sign in to comment.