Skip to content

Commit 3ec85ce

Browse files
[FrameworkBundle][Serializer] Deprecate annotations
1 parent 38e4119 commit 3ec85ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
use Symfony\Component\Semaphore\Store\StoreFactory as SemaphoreStoreFactory;
157157
use Symfony\Component\Serializer\Encoder\DecoderInterface;
158158
use Symfony\Component\Serializer\Encoder\EncoderInterface;
159-
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
159+
use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
160160
use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
161161
use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
162162
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
@@ -1926,7 +1926,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
19261926
$serializerLoaders = [];
19271927
if (isset($config['enable_attributes']) && $config['enable_attributes']) {
19281928
$annotationLoader = new Definition(
1929-
AnnotationLoader::class,
1929+
AttributeLoader::class,
19301930
[new Reference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE)]
19311931
);
19321932

Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
use Symfony\Component\Notifier\TexterInterface;
6666
use Symfony\Component\PropertyAccess\PropertyAccessor;
6767
use Symfony\Component\Security\Core\AuthenticationEvents;
68-
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
68+
use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
6969
use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
7070
use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
7171
use Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer;
@@ -1489,7 +1489,7 @@ public function testSerializerEnabled()
14891489
$argument = $container->getDefinition('serializer.mapping.chain_loader')->getArgument(0);
14901490

14911491
$this->assertCount(2, $argument);
1492-
$this->assertEquals(AnnotationLoader::class, $argument[0]->getClass());
1492+
$this->assertEquals(AttributeLoader::class, $argument[0]->getClass());
14931493
$this->assertEquals(new Reference('serializer.name_converter.camel_case_to_snake_case'), $container->getDefinition('serializer.name_converter.metadata_aware')->getArgument(1));
14941494
$this->assertEquals(new Reference('property_info', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE), $container->getDefinition('serializer.normalizer.object')->getArgument(3));
14951495
$this->assertArrayHasKey('circular_reference_handler', $container->getDefinition('serializer.normalizer.object')->getArgument(6));

0 commit comments

Comments
 (0)