8000 Merge branch '6.1' into 6.2 · symfony/symfony@5667f62 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5667f62

Browse files
Merge branch '6.1' into 6.2
* 6.1: [HttpKernel] Fix test sensitivity on xdebug.file_link_format [HttpKernel] Fix non-scalar check in surrogate fragment renderer [HtmlSanitizer] Allow null for sanitizer option `allowed_link_hosts` and `allowed_media_hosts` [Serializer] Fix wrong needsNormalization in TraceableEncoder [Debug][ErrorHandler] fix operator precedence [Cache] Ensured that redis adapter can use multiple redis sentinel hosts [DoctrineBridge] fix tests [Security] Allow redirect after login to absolute URLs
2 parents 43c09ab + d7b69a5 commit 5667f62

26 files changed

+129
-60
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
env:
172172
REDIS_HOST: 'localhost:16379'
173173
REDIS_CLUSTER_HOSTS: 'localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
174-
REDIS_SENTINEL_HOSTS: 'localhost:26379'
174+
REDIS_SENTINEL_HOSTS: 'localhost:26379 localhost:26379 localhost:26379'
175175
REDIS_SENTINEL_SERVICE: redis_sentinel
176176
MESSENGER_REDIS_DSN: redis://127.0.0.1:7006/messages
177177
MESSENGER_AMQP_DSN: amqp://localhost/%2f/messages

src/Symfony/Bridge/Doctrine/Tests/IdGenerator/EntityManager.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UlidGeneratorTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Tests\IdGenerator;
1313

14+
use Doctrine\ORM\EntityManager;
1415
use Doctrine\ORM\Mapping\Entity;
1516
use PHPUnit\Framework\TestCase;
1617
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
@@ -21,7 +22,7 @@ class UlidGeneratorTest extends TestCase
2122
{
2223
public function testUlidCanBeGenerated()
2324
{
24-
$em = new EntityManager();
25+
$em = (new \ReflectionClass(EntityManager::class))->newInstanceWithoutConstructor();
2526
$generator = new UlidGenerator();
2627
$ulid = $generator->generate($em, new Entity());
2728

@@ -32,7 +33,7 @@ public function testUlidCanBeGenerated()
3233
public function testUlidFactory()
3334
{
3435
$ulid = new Ulid('00000000000000000000000000');
35-
$em = new EntityManager();
36+
$em = (new \ReflectionClass(EntityManager::class))->newInstanceWithoutConstructor();
3637
$factory = $this->createMock(UlidFactory::class);
3738
$factory->expects($this->any())
3839
->method('create')

src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Tests\IdGenerator;
1313

14+
use Doctrine\ORM\EntityManager;
1415
use PHPUnit\Framework\TestCase;
1516
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
1617
use Symfony\Component\Uid\Factory\UuidFactory;
@@ -22,7 +23,7 @@ class UuidGeneratorTest extends TestCase
2223
{
2324
public function testUuidCanBeGenerated()
2425
{
25-
$em = new EntityManager();
26+
$em = (new \ReflectionClass(EntityManager::class))->newInstanceWithoutConstructor();
2627
$generator = new UuidGenerator();
2728
$uuid = $generator->generate($em, new Entity());
2829

@@ -32,7 +33,7 @@ public function testUuidCanBeGenerated()
3233
public function testCustomUuidfactory()
3334
{
3435
$uuid = new UuidV4();
35-
$em = new EntityManager();
36+
$em = (new \ReflectionClass(EntityManager::class))->newInstanceWithoutConstructor();
3637
$factory = $this->createMock(UuidFactory::class);
3738
$factory->expects($this->any())
3839
->method('create')
@@ -44,7 +45,7 @@ public function testCustomUuidfactory()
4445

4546
public function testUuidfactory()
4647
{
47-
$em = new EntityManager();
48+
$em = (new \ReflectionClass(EntityManager::class))->newInstanceWithoutConstructor();
4849
$generator = new UuidGenerator();
4950
$this->assertInstanceOf(UuidV6::class, $generator->generate($em, new Entity()));
5051

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,9 +2224,13 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable
22242224
->info('Allows only a given list of schemes to be used in links href attributes.')
22252225
->scalarPrototype()->end()
22262226
->end()
2227-
->arrayNode('allowed_link_hosts')
2227+
->variableNode('allowed_link_hosts')
22282228
->info('Allows only a given list of hosts to be used in links href attributes.')
2229-
->scalarPrototype()->end()
2229+
->defaultValue(null)
2230+
->validate()
2231+
->ifTrue(function ($v) { return !\is_array($v) && null !== $v; })
2232+
->thenInvalid('The "allowed_link_hosts" parameter must be an array or null')
2233+
->end()
22302234
->end()
22312235
->booleanNode('allow_relative_links')
22322236
->info('Allows relative URLs to be used in links href attributes.')
@@ -2236,9 +2240,13 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable
22362240
->info('Allows only a given list of schemes to be used in media source attributes (img, audio, video, ...).')
22372241
->scalarPrototype()->end()
22382242
->end()
2239-
->arrayNode('allowed_media_hosts')
2243+
->variableNode('allowed_media_hosts')
22402244
->info('Allows only a given list of hosts to be used in media source attributes (img, audio, video, ...).')
2241-
->scalarPrototype()->end()
2245+
->defaultValue(null)
2246+
->validate()
2247+
->ifTrue(function ($v) { return !\is_array($v) && null !== $v; })
2248+
->thenInvalid('The "allowed_media_hosts" parameter must be an array or null')
2249+
->end()
22422250
->end()
22432251
->booleanNode('allow_relative_medias')
22442252
->info('Allows relative URLs to be used in media source attributes (img, audio, video, ...).')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', [
4+
'http_method_override' => false,
5+
'html_sanitizer' => [
6+
'sanitizers' => [
7+
'custom_default' => null,
8+
],
9+
],
10+
]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<config xmlns="http://symfony.com/schema/dic/symfony" http-method-override="false">
9+
<html-sanitizer>
10+
<sanitizer name="custom_default"/>
11+
</html-sanitizer>
12+
</config>
13+
</container>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
framework:
2+
http_method_override: false
3+
html_sanitizer:
4+
sanitizers:
5+
custom_default: ~

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,6 +2111,15 @@ static function ($call) {
21112111
$this->assertFalse($container->hasAlias(HtmlSanitizerInterface::class.' $default'));
21122112
}
21132113

2114+
public function testHtmlSanitizerDefaultNullAllowedLinkMediaHost()
2115+
{
2116+
$container = $this->createContainerFromFile('html_sanitizer_default_allowed_link_and_media_hosts');
2117+
2118+
$calls = $container->getDefinition('html_sanitizer.config.custom_default')->getMethodCalls();
2119+
$this->assertContains(['allowLinkHosts', [null], true], $calls);
2120+
$this->assertContains(['allowMediaHosts', [null], true], $calls);
2121+
}
2122+
21142123
public function testHtmlSanitizerDefaultConfig()
21152124
{
21162125
$container = $this->createContainerFromFile('html_sanitizer_default_config');

src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterSentinelTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ public function testInvalidDSNHasBothClusterAndSentinel()
4747
public function testExceptionMessageWhenFailingToRetrieveMasterInformation()
4848
{
4949
$hosts = getenv('REDIS_SENTINEL_HOSTS');
50-
$firstHost = explode(' ', $hosts)[0];
50+
$dsn = 'redis:?host['.str_replace(' ', ']&host[', $hosts).']';
5151
$this->expectException(\Symfony\Component\Cache\Exception\InvalidArgumentException::class);
52-
$this->expectExceptionMessage('Failed to retrieve master information from master name "invalid-masterset-name" and address "'.$firstHost.'".');
53-
AbstractAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['redis_sentinel' => 'invalid-masterset-name']);
52+
$this->expectExceptionMessage('Failed to retrieve master information from sentinel "invalid-masterset-name" and dsn "'.$dsn.'".');
53+
AbstractAdapter::createConnection($dsn, ['redis_sentinel' => 'invalid-masterset-name']);
5454
}
5555
}

src/Symfony/Component/Cache/Traits/RedisTrait.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static function createConnection(string $dsn, array $options = []): \Redi
174174
}
175175

176176
if (null === $params['class'] && \extension_loaded('redis')) {
177-
$class = $params['redis_cluster'] ? \RedisCluster::class : (1 < \count($hosts) ? \RedisArray::class : \Redis::class);
177+
$class = $params['redis_cluster'] ? \RedisCluster::class : (1 < \count($hosts) && !isset($params['redis_sentinel']) ? \RedisArray::class : \Redis::class);
178178
} else {
179179
$class = $params['class'] ?? \Predis\Client::class;
180180

@@ -188,21 +188,29 @@ public static function createConnection(string $dsn, array $options = []): \Redi
188188
$redis = new $class();
189189

190190
$initializer = static function ($redis) use ($connect, $params, $dsn, $auth, $hosts, $tls) {
191-
$host = $hosts[0]['host'] ?? $hosts[0]['path'];
192-
$port = $hosts[0]['port'] ?? 0;
191+
$hostIndex = 0;
192+
do {
193+
$host = $hosts[$hostIndex]['host'] ?? $hosts[$hostIndex]['path'];
194+
$port = $hosts[$hostIndex]['port'] ?? 0;
195+
$address = false;
196+
197+
if (isset($hosts[$hostIndex]['host']) && $tls) {
198+
$host = 'tls://'.$host;
199+
}
193200

194-
if (isset($hosts[0]['host']) && $tls) {
195-
$host = 'tls://'.$host;
196-
}
201+
if (!isset($params['redis_sentinel'])) {
202+
break;
203+
}
197204

198-
if (isset($params['redis_sentinel'])) {
199205
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']);
200206

201-
if (!$address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
202-
throw new InvalidArgumentException(sprintf('Failed to retrieve master information from master name "%s" and address "%s:%d".', $params['redis_sentinel'], $host, $port));
207+
if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
208+
[$host, $port] = $address;
203209
}
210+
} while (++$hostIndex < \count($hosts) && !$address);
204211

205-
[$host, $port] = $address;
212+
if (isset($params['redis_sentinel']) && !$address) {
213+
throw new InvalidArgumentException(sprintf('Failed to retrieve master information from sentinel "%s" and dsn "%s".', $params['redis_sentinel'], $dsn));
206214
}
207215

208216
try {

src/Symfony/Component/ErrorHandler/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public function screamAt(int $levels, bool $replace = false): int
359359
*/
360360
private function reRegister(int $prev): void
361361
{
362-
if ($prev !== $this->thrownErrors | $this->loggedErrors) {
362+
if ($prev !== ($this->thrownErrors | $this->loggedErrors)) {
363363
$handler = set_error_handler('is_int');
364364
$handler = \is_array($handler) ? $handler[0] : null;
365365
restore_error_handler();

src/Symfony/Component/Finder/Tests/Fixtures/gitignore/search_root/a.txt

Whitespace-only changes.

src/Symfony/Component/Finder/Tests/Fixtures/gitignore/search_root/c.txt

Whitespace-only changes.

src/Symfony/Component/Finder/Tests/Fixtures/gitignore/search_root/dir/b.txt

Whitespace-only changes.

src/Symfony/Component/Finder/Tests/Fixtures/gitignore/search_root/dir/c.txt

Whitespace-only changes.

src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
4545

4646
public function __construct(Stopwatch $stopwatch = null, string|FileLinkFormatter $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, DataDumperInterface|Connection $dumper = null)
4747
{
48+
$fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
4849
$this->stopwatch = $stopwatch;
49-
$this->fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
50+
$this->fileLinkFormat = $fileLinkFormat instanceof FileLinkFormatter && false === $fileLinkFormat->format('', 0) ? false : $fileLinkFormat;
5051
$this->charset = $charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8';
5152
$this->requestStack = $requestStack;
5253
$this->dumper = $dumper;

src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ class FileLinkFormatter
3333
/**
3434
* @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand
3535
*/
36-
public function __construct(string $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, string|\Closure $urlFormat = null)
36+
public function __construct(string|array $fileLinkFormat = null, RequestStack $requestStack = null, string $baseDir = null, string|\Closure $urlFormat = null)
3737
{
38-
$fileLinkFormat ??= $_SERVER['SYMFONY_IDE'] ?? null;
39-
$fileLinkFormat = (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false;
40-
if ($fileLinkFormat && !\is_array($fileLinkFormat)) {
38+
$fileLinkFormat ??= $_SERVER['SYMFONY_IDE'] ?? '';
39+
if (!\is_array($fileLinkFormat) && $fileLinkFormat = (ErrorRendererInterface::IDE_LINK_FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false) {
4140
$i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f);
4241
$fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, \PREG_SPLIT_DELIM_CAPTURE);
4342
}

src/Symfony/Component/HttpKernel/Fragment/AbstractSurrogateFragmentRenderer.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ private function generateSignedFragmentUri(ControllerReference $uri, Request $re
8989
private function containsNonScalars(array $values): bool
9090
{
9191
foreach ($values as $value) {
92-
if (\is_array($value)) {
93-
return $this->containsNonScalars($value);
94-
} elseif (!\is_scalar($value) && null !== $value) {
92+
if (\is_scalar($value) || null === $value) {
93+
continue;
94+
}
95+
96+
if (!\is_array($value) || $this->containsNonScalars($value)) {
9597
return true;
9698
}
9799
}

src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\Response;
1717
use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector;
18+
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
1819
use Symfony\Component\VarDumper\Cloner\Data;
1920
use Symfony\Component\VarDumper\Dumper\CliDumper;
2021
use Symfony\Component\VarDumper\Server\Connection;
@@ -28,7 +29,7 @@ public function testDump()
2829
{
2930
$data = new Data([[123]]);
3031

31-
$collector = new DumpDataCollector();
32+
$collector = new DumpDataCollector(null, new FileLinkFormatter([]));
3233

3334
$this->assertSame('dump', $collector->getName());
3435

src/Symfony/Component/HttpKernel/Tests/Debug/FileLinkFormatterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FileLinkFormatterTest extends TestCase
2020
{
2121
public function testWhenNoFileLinkFormatAndNoRequest()
2222
{
23-
$sut = new FileLinkFormatter();
23+
$sut = new FileLinkFormatter([]);
2424

2525
$this->assertFalse($sut->format('/kernel/root/src/my/very/best/file.php', 3));
2626
}
@@ -54,7 +54,7 @@ public function testWhenNoFileLinkFormatAndRequest()
5454
$request->server->set('SCRIPT_FILENAME', '/public/index.php');
5555
$request->server->set('REQUEST_URI', '/index.php/example');
5656

57-
$sut = new FileLinkFormatter(null, $requestStack, __DIR__, '/_profiler/open?file=%f&line=%l#line%l');
57+
$sut = new FileLinkFormatter([], $requestStack, __DIR__, '/_profiler/open?file=%f&line=%l#line%l');
5858

5959
$this->assertSame('http://www.example.org/_profiler/open?file=file.php&line=3#line3', $sut->format($file, 3));
6060
}

src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationFailureHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
7272
$options = $this->options;
7373
$failureUrl = ParameterBagUtils::getRequestParameterValue($request, $options['failure_path_parameter']);
7474

75-
if (\is_string($failureUrl) && str_starts_with($failureUrl, '/')) {
75+
if (\is_string($failureUrl) && (str_starts_with($failureUrl, '/') || str_starts_with($failureUrl, 'http'))) {
7676
$options['failure_path'] = $failureUrl;
7777
} elseif ($this->logger && $failureUrl) {
7878
$this->logger->debug(sprintf('Ignoring query parameter "%s": not a valid URL.', $options['failure_path_parameter']));

src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function determineTargetUrl(Request $request): string
9494

9595
$targetUrl = ParameterBagUtils::getRequestParameterValue($request, $this->options['target_path_parameter']);
9696

97-
if (\is_string($targetUrl) && str_starts_with($targetUrl, '/')) {
97+
if (\is_string($targetUrl) && (str_starts_with($targetUrl, '/') || str_starts_with($targetUrl, 'http'))) {
9898
return $targetUrl;
9999
}
100100

src/Symfony/Component/Security/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,21 @@ public function testFailurePathFromRequestWithInvalidUrl()
207207
$handler->onAuthenticationFailure($this->request, $this->exception);
208208
}
209209

210+
public function testAbsoluteUrlRedirectionFromRequest()
211+
{
212+
$options = ['failure_path_parameter' => '_my_failure_path'];
213+
214+
$this->request->expects($this->once())
215+
->method('get')->with('_my_failure_path')
216+
->willReturn('https://localhost/some-path');
217+
218+
$this->httpUtils->expects($this->once())
219+
->method('createRedirectResponse')->with($this->request, 'https://localhost/some-path');
220+
221+
$handler = new DefaultAuthenticationFailureHandler($this->httpKernel, $this->httpUtils, $options, $this->logger);
222+
$handler->onAuthenticationFailure($this->request, $this->exception);
223+
}
224+
210225
private function getRequest()
211226
{
212227
$request = $this->createMock(Request::class);

src/Symfony/Component/Security/Http/Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,21 @@ public function testTargetPathFromRequestWithInvalidUrl()
135135

136136
$handler->onAuthenticationSuccess($request, $token);
137137
}
138+
139+
public function testTargetPathWithAbsoluteUrlFromRequest()
140+
{
141+
$options = ['target_path_parameter' => '_my_target_path'];
142+
143+
$request = $this->createMock(Request::class);
144+
$request->expects($this->once())
145+
->method('get')->with('_my_target_path')
146+
->willReturn('https://localhost/some-path');
147+
148+
$httpUtils = $this->createMock(HttpUtils::class);
149+
$httpUtils->expects($this->once())
150+
->method('createRedirectResponse')->with($request, 'https://localhost/some-path');
151+
152+
$handler = new DefaultAuthenticationSuccessHandler($httpUtils, $options);
153+
$handler->onAuthenticationSuccess($request, $this->createMock(TokenInterface::class));
154+
}
138155
}

src/Symfony/Component/Serializer/Debug/TraceableEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use Symfony\Component\Serializer\DataCollector\SerializerDataCollector;
1515
use Symfony\Component\Serializer\Encoder\DecoderInterface;
1616
use Symfony\Component\Serializer\Encoder\EncoderInterface;
17+
use Symfony\Component\Serializer\Encoder\NormalizationAwareInterface;
1718
use Symfony\Component\Serializer\SerializerAwareInterface;
1819
use Symfony\Component\Serializer\SerializerInterface;
19-
use Symfony\Component\Serializer\Tests\Encoder\NormalizationAwareEncoder;
2020

2121
/**
2222
* Collects some data about encoding.
@@ -111,7 +111,7 @@ public function setSerializer(SerializerInterface $serializer)
111111

112112
public function needsNormalization(): bool
113113
{
114-
return !$this->encoder instanceof NormalizationAwareEncoder;
114+
return !$this->encoder instanceof NormalizationAwareInterface;
115115
}
116116

117117
/**

0 commit comments

Comments
 (0)
0