From 2a61c3ff45b1d6528b35b9d5d4b66459ed7b6404 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Mon, 9 Sep 2024 14:52:28 +0200 Subject: [PATCH] Implement http exception to be compatible with HTTP mock client --- src/Test/UseHttpFactories.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Test/UseHttpFactories.php b/src/Test/UseHttpFactories.php index fade997..c1c77e7 100644 --- a/src/Test/UseHttpFactories.php +++ b/src/Test/UseHttpFactories.php @@ -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; @@ -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 { }; } }