8000 revert implementing LoggerAwareInterface in HTTP client decorators · symfony/symfony@67c4025 · GitHub
[go: up one dir, main page]

Skip to content

Commit 67c4025

Browse files
committed
revert implementing LoggerAwareInterface in HTTP client decorators
1 parent c168c2c commit 67c4025

File tree

5 files changed

+5
-50
lines changed

5 files changed

+5
-50
lines changed

src/Symfony/Component/HttpClient/CachingHttpClient.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\HttpClient;
1313

14-
use Psr\Log\LoggerAwareInterface;
15-
use Psr\Log\LoggerInterface;
1614
use Symfony\Component\HttpClient\Response\MockResponse;
1715
use Symfony\Component\HttpClient\Response\ResponseStream;
1816
use Symfony\Component\HttpFoundation\Request;
@@ -33,7 +31,7 @@
3331
*
3432
* @author Nicolas Grekas <p@tchwork.com>
3533
*/
36-
class CachingHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface
34+
class CachingHttpClient implements HttpClientInterface, ResetInterface
3735
{
3836
use HttpClientTrait;
3937

@@ -144,11 +142,4 @@ public function reset(): void
144142
$this->client->reset();
145143
}
146144
}
147-
148-
public function setLogger(LoggerInterface $logger): void
149-
{
150-
if ($this->client instanceof LoggerAwareInterface) {
151-
$this->client->setLogger($logger);
152-
}
153-
}
154145
}

src/Symfony/Component/HttpClient/EventSourceHttpClient.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\HttpClient;
1313

14-
use Psr\Log\LoggerAwareInterface;
15-
use Psr\Log\LoggerInterface;
1614
use Symfony\Component\HttpClient\Chunk\ServerSentEvent;
1715
use Symfony\Component\HttpClient\Exception\EventSourceException;
1816
use Symfony\Component\HttpClient\Response\AsyncContext;
@@ -27,7 +25,7 @@
2725
* @author Antoine Bluchet <soyuka@gmail.com>
2826
* @author Nicolas Grekas <p@tchwork.com>
2927
*/
30-
final class EventSourceHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface
28+
final class EventSourceHttpClient implements HttpClientInterface, ResetInterface
3129
{
3230
use AsyncDecoratorTrait, HttpClientTrait {
3331
AsyncDecoratorTrait::withOptions insteadof HttpClientTrait;
@@ -158,11 +156,4 @@ public function request(string $method, string $url, array $options = []): Respo
158156
}
159157
});
160158
}
161-
162-
public function setLogger(LoggerInterface $logger): void
163-
{
164-
if ($this->client instanceof LoggerAwareInterface) {
165-
$this->client->setLogger($logger);
166-
}
167-
}
168159
}

src/Symfony/Component/HttpClient/RetryableHttpClient.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\HttpClient;
1313

14-
use Psr\Log\LoggerAwareInterface;
1514
use Psr\Log\LoggerInterface;
1615
use Symfony\Component\HttpClient\Response\AsyncContext;
1716
use Symfony\Component\HttpClient\Response\AsyncResponse;
@@ -28,7 +27,7 @@
2827
*
2928
* @author Jérémy Derussé <jeremy@derusse.com>
3029
*/
31-
class RetryableHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface
30+
class RetryableHttpClient implements HttpClientInterface, ResetInterface
3231
{
3332
use AsyncDecoratorTrait;
3433

@@ -164,14 +163,6 @@ public function request(string $method, string $url, array $options = []): Respo
164163
});
165164
}
166165

167-
public function setLogger(LoggerInterface $logger): void
168-
{
169-
$this->logger = $logger;
170-
if ($this->client instanceof LoggerAwareInterface) {
171-
$this->client->setLogger($logger);
172-
}
173-
}
174-
175166
private function getDelayFromHeader(array $headers): ?int
176167
{
177168
if (null !== $after = $headers['retry-after'][0] ?? null) {

src/Symfony/Component/HttpClient/ThrottlingHttpClient.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\HttpClient;
1313

14-
use Psr\Log\LoggerAwareInterface;
15-
use Psr\Log\LoggerInterface;
1614
use Symfony\Component\RateLimiter\LimiterInterface;
1715
use Symfony\Contracts\HttpClient\HttpClientInterface;
1816
use Symfony\Contracts\HttpClient\ResponseInterface;
@@ -21,7 +19,7 @@
2119
/**
2220
* Limits the number of requests within a certain period.
2321
*/
24-
class ThrottlingHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface
22+
class ThrottlingHttpClient implements HttpClientInterface, ResetInterface
2523
{
2624
use DecoratorTrait {
2725
reset as private traitReset;
@@ -50,11 +48,4 @@ public function reset(): void
5048
$this->traitReset();
5149
$this->rateLimiter->reset();
5250
}
53-
54-
public function setLogger(LoggerInterface $logger): void
55-
{
56-
if ($this->client instanceof LoggerAwareInterface) {
57-
$this->client->setLogger($logger);
58-
}
59-
}
6051
}

src/Symfony/Component/HttpClient/UriTemplateHttpClient.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111

1212
namespace Symfony\Component\HttpClient;
1313

14-
use Psr\Log\LoggerAwareInterface;
15-
use Psr\Log\LoggerInterface;
1614
use Symfony\Contracts\HttpClient\HttpClientInterface;
1715
use Symfony\Contracts\HttpClient\ResponseInterface;
1816
use Symfony\Contracts\Service\ResetInterface;
1917

20-
class UriTemplateHttpClient implements HttpClientInterface, LoggerAwareInterface, ResetInterface
18+
class UriTemplateHttpClient implements HttpClientInterface, ResetInterface
2119
{
2220
use DecoratorTrait;
2321

@@ -64,13 +62,6 @@ public function withOptions(array $options): static
6462
return $clone;
6563
}
6664

67-
public function setLogger(LoggerInterface $logger): void
68-
{
69-
if ($this->client instanceof LoggerAwareInterface) {
70-
$this->client->setLogger($logger);
71-
}
72-
}
73-
7465
/**
7566
* @return \Closure(string $url, array $vars): string
7667
*/

0 commit comments

Comments
 (0)
0