diff --git a/src/Symfony/Component/HttpClient/CachingHttpClient.php b/src/Symfony/Component/HttpClient/CachingHttpClient.php index f576a14a00a0b..fd6a18c3cc1b1 100644 --- a/src/Symfony/Component/HttpClient/CachingHttpClient.php +++ b/src/Symfony/Component/HttpClient/CachingHttpClient.php @@ -11,8 +11,6 @@ namespace Symfony\Component\HttpClient; -use Psr\Log\LoggerAwareInterface; -use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\Response\MockResponse; use Symfony\Component\HttpClient\Response\ResponseStream; use Symfony\Component\HttpFoundation\Request; @@ -33,7 +31,7 @@ * * @author Nicolas Grekas */ -class CachingHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface +class CachingHttpClient implements HttpClientInterface, ResetInterface { use HttpClientTrait; @@ -144,11 +142,4 @@ public function reset(): void $this->client->reset(); } } - - public function setLogger(LoggerInterface $logger): void - { - if ($this->client instanceof LoggerAwareInterface) { - $this->client->setLogger($logger); - } - } } diff --git a/src/Symfony/Component/HttpClient/EventSourceHttpClient.php b/src/Symfony/Component/HttpClient/EventSourceHttpClient.php index 7bb43532cbbc0..4e551ac0409f6 100644 --- a/src/Symfony/Component/HttpClient/EventSourceHttpClient.php +++ b/src/Symfony/Component/HttpClient/EventSourceHttpClient.php @@ -11,8 +11,6 @@ namespace Symfony\Component\HttpClient; -use Psr\Log\LoggerAwareInterface; -use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\Chunk\ServerSentEvent; use Symfony\Component\HttpClient\Exception\EventSourceException; use Symfony\Component\HttpClient\Response\AsyncContext; @@ -27,7 +25,7 @@ * @author Antoine Bluchet * @author Nicolas Grekas */ -final class EventSourceHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface +final class EventSourceHttpClient implements HttpClientInterface, ResetInterface { use AsyncDecoratorTrait, HttpClientTrait { AsyncDecoratorTrait::withOptions insteadof HttpClientTrait; @@ -158,11 +156,4 @@ public function request(string $method, string $url, array $options = []): Respo } }); } - - public function setLogger(LoggerInterface $logger): void - { - if ($this->client instanceof LoggerAwareInterface) { - $this->client->setLogger($logger); - } - } } diff --git a/src/Symfony/Component/HttpClient/RetryableHttpClient.php b/src/Symfony/Component/HttpClient/RetryableHttpClient.php index 412dfa262ab77..d3b779420ffa9 100644 --- a/src/Symfony/Component/HttpClient/RetryableHttpClient.php +++ b/src/Symfony/Component/HttpClient/RetryableHttpClient.php @@ -11,7 +11,6 @@ namespace Symfony\Component\HttpClient; -use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\Response\AsyncContext; use Symfony\Component\HttpClient\Response\AsyncResponse; @@ -28,7 +27,7 @@ * * @author Jérémy Derussé */ -class RetryableHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface +class RetryableHttpClient implements HttpClientInterface, ResetInterface { use AsyncDecoratorTrait; @@ -164,14 +163,6 @@ public function request(string $method, string $url, array $options = []): Respo }); } - public function setLogger(LoggerInterface $logger): void - { - $this->logger = $logger; - if ($this->client instanceof LoggerAwareInterface) { - $this->client->setLogger($logger); - } - } - private function getDelayFromHeader(array $headers): ?int { if (null !== $after = $headers['retry-after'][0] ?? null) { diff --git a/src/Symfony/Component/HttpClient/ThrottlingHttpClient.php b/src/Symfony/Component/HttpClient/ThrottlingHttpClient.php index d3125ff444b39..66fc173053771 100644 --- a/src/Symfony/Component/HttpClient/ThrottlingHttpClient.php +++ b/src/Symfony/Component/HttpClient/ThrottlingHttpClient.php @@ -11,8 +11,6 @@ namespace Symfony\Component\HttpClient; -use Psr\Log\LoggerAwareInterface; -use Psr\Log\LoggerInterface; use Symfony\Component\RateLimiter\LimiterInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\ResponseInterface; @@ -21,7 +19,7 @@ /** * Limits the number of requests within a certain period. */ -class ThrottlingHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface +class ThrottlingHttpClient implements HttpClientInterface, ResetInterface { use DecoratorTrait { reset as private traitReset; @@ -50,11 +48,4 @@ public function reset(): void $this->traitReset(); $this->rateLimiter->reset(); } - - public function setLogger(LoggerInterface $logger): void - { - if ($this->client instanceof LoggerAwareInterface) { - $this->client->setLogger($logger); - } - } } diff --git a/src/Symfony/Component/HttpClient/UriTemplateHttpClient.php b/src/Symfony/Component/HttpClient/UriTemplateHttpClient.php index ccbd4a2d83cf3..2767ed3687eaf 100644 --- a/src/Symfony/Component/HttpClient/UriTemplateHttpClient.php +++ b/src/Symfony/Component/HttpClient/UriTemplateHttpClient.php @@ -11,13 +11,11 @@ namespace Symfony\Component\HttpClient; -use Psr\Log\LoggerAwareInterface; -use Psr\Log\LoggerInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\ResponseInterface; use Symfony\Contracts\Service\ResetInterface; -class UriTemplateHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface +class UriTemplateHttpClient implements HttpClientInterface, ResetInterface { use DecoratorTrait; @@ -64,13 +62,6 @@ public function withOptions(array $options): static return $clone; } - public function setLogger(LoggerInterface $logger): void - { - if ($this->client instanceof LoggerAwareInterface) { - $this->client->setLogger($logger); - } - } - /** * @return \Closure(string $url, array $vars): string */