Skip to content

Commit

Permalink
Merge pull request #41 from veewee/exception
Browse files Browse the repository at this point in the history
Implement http exception to be compatible with HTTP mock client
  • Loading branch information
veewee authored Sep 9, 2024
2 parents ee9ca4b + 2a61c3f commit 69018d6
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 69018d6

Please sign in to comment.