Skip to content

Commit f0360f2

Browse files
feature #51470 [FrameworkBundle][Serializer] Deprecate annotations (alexandre-daubois)
This PR was merged into the 6.4 branch. Discussion ---------- [FrameworkBundle][Serializer] Deprecate annotations | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - Part of symfony/symfony#51381 Commits ------- a6586923e7 [FrameworkBundle][Serializer] Deprecate annotations
2 parents 2749073 + 3ec85ce commit f0360f2

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
@@ -157,7 +157,7 @@
157157
use Symfony\Component\Semaphore\Store\StoreFactory as SemaphoreStoreFactory;
158158
use Symfony\Component\Serializer\Encoder\DecoderInterface;
159159
use Symfony\Component\Serializer\Encoder\EncoderInterface;
160-
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
160+
use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
161161
use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
162162
use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
163163
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
@@ -1932,7 +1932,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
19321932
$serializerLoaders = [];
19331933
if (isset($config['enable_attributes']) && $config['enable_attributes']) {
19341934
$annotationLoader = new Definition(
1935-
AnnotationLoader::class,
1935+
AttributeLoader::class,
19361936
[new Reference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE)]
19371937
);
19381938

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)