8000 deprecate setLogger() methods of decorating clients · symfony/symfony@9d95152 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d95152

Browse files
committed
deprecate setLogger() methods of decorating clients
1 parent 4c84578 commit 9d95152

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

UPGRADE-7.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Components
2929
* [ExpressionLanguage](#ExpressionLanguage)
3030
* [Form](#Form)
3131
* [Intl](#Intl)
32+
* [HttpClient](#HttpClient)
3233
* [PropertyInfo](#PropertyInfo)
3334
* [Translation](#Translation)
3435
* [Workflow](#Workflow)
@@ -72,6 +73,11 @@ FrameworkBundle
7273
* Deprecate the `router.cache_dir` config option, the Router will always use the `kernel.build_dir` parameter
7374
* Reset env vars when resetting the container
7475

76+
HttpClient
77+
----------
78+
79+
* Deprecate the `setLogger()` methods of the `NoPrivateNetworkHttpClient`, `TraceableHttpClient` and `ScopingHttpClient` classes, configure the logger of the wrapped clients directly instead
80+
7581
Intl
7682
----
7783

src/Symfony/Component/HttpClient/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CHANGELOG
88
* Allow mocking `start_time` info in `MockResponse`
99
* Add `MockResponse::fromFile()` and `JsonMockResponse::fromFile()` methods to help using fixtures files
1010
* Add `ThrottlingHttpClient` to enable limiting the number of requests within a certain period
11+
* Deprecate the `setLogger()` methods of the `NoPrivateNetworkHttpClient`, `TraceableHttpClient` and `ScopingHttpClient` classes, configure the logger of the wrapped clients directly instead
1112

1213
7.0
1314
---

src/Symfony/Component/HttpClient/NoPrivateNetworkHttpClient.php

Lines changed: 5 additions & 0 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ public function stream(ResponseInterface|iterable $responses, ?float $timeout =
7777
return $this->client->stream($responses, $timeout);
7878
}
7979

80+
/**
81+
* @deprecated since Symfony 7.1, configure the logger on the wrapper HTTP client directly instead
82+
*/
8083
public function setLogger(LoggerInterface $logger): void
8184
{
85+
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapper HTTP client directly instead.');
86+
8287
if ($this->client instanceof LoggerAwareInterface) {
8388
$this->client->setLogger($logger);
8489
}

src/Symfony/Component/HttpClient/ScopingHttpClient.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,13 @@ public function reset(): void
100100
}
101101
}
102102

103+
/**
104+
* @deprecated since Symfony 7.1, configure the logger on the wrapper HTTP client directly instead
105+
*/
103106
public function setLogger(LoggerInterface $logger): void
104107
{
108+
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapper HTTP client directly instead.');
109+
105110
if ($this->client instanceof LoggerAwareInterface) {
106111
$this->client->setLogger($logger);
107112
}

src/Symfony/Component/HttpClient/TraceableHttpClient.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,13 @@ public function reset(): void
8989
$this->tracedRequests->exchangeArray([]);
9090
}
9191

92+
/**
93+
* @deprecated since Symfony 7.1, configure the logger on the wrapper HTTP client directly instead
94+
*/
9295
public function setLogger(LoggerInterface $logger): void
9396
{
97+
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapper HTTP client directly instead.');
98+
9499
if ($this->client instanceof LoggerAwareInterface) {
95100
$this->client->setLogger($logger);
96101
}

0 commit comments

Comments
 (0)
0