框架升级及修复升级后的bug
This commit is contained in:
+15
-1
@@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\HttpClient;
|
||||
|
||||
use Psr\Log\LoggerAwareInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\HttpClient\Exception\InvalidArgumentException;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||
@@ -22,7 +24,7 @@ use Symfony\Contracts\Service\ResetInterface;
|
||||
*
|
||||
* @author Anthony Martin <anthony.martin@sensiolabs.com>
|
||||
*/
|
||||
class ScopingHttpClient implements HttpClientInterface, ResetInterface
|
||||
class ScopingHttpClient implements HttpClientInterface, ResetInterface, LoggerAwareInterface
|
||||
{
|
||||
use HttpClientTrait;
|
||||
|
||||
@@ -100,6 +102,18 @@ class ScopingHttpClient implements HttpClientInterface, ResetInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since Symfony 7.1, configure the logger on the wrapped HTTP client directly instead
|
||||
*/
|
||||
public function setLogger(LoggerInterface $logger): void
|
||||
{
|
||||
trigger_deprecation('symfony/http-client', '7.1', 'Configure the logger on the wrapped HTTP client directly instead.');
|
||||
|
||||
if ($this->client instanceof LoggerAwareInterface) {
|
||||
$this->client->setLogger($logger);
|
||||
}
|
||||
}
|
||||
|
||||
public function withOptions(array $options): static
|
||||
{
|
||||
$clone = clone $this;
|
||||
|
||||
Reference in New Issue
Block a user