Skip to content

Commit d9bc414

Browse files
committed
bug #14989 [FrameworkBundle] Reuse PropertyAccessor service for ObjectNormalizer (dunglas)
This PR was squashed before being merged into the 2.7 branch (closes #14989). Discussion ---------- [FrameworkBundle] Reuse PropertyAccessor service for ObjectNormalizer | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Inject the `property_accessor` service if available in the `ObjectNormalize` instead of creating a new instance. Commits ------- 256d441 [FrameworkBundle] Reuse PropertyAccessor service for ObjectNormalizer
2 parents c5e0681 + e3bd78b commit d9bc414

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Resources/config/form.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
</service>
5656

5757
<!-- CoreExtension -->
58+
<service id="form.property_accessor" alias="property_accessor" public="false" />
59+
5860
<service id="form.type.form" class="Symfony\Component\Form\Extension\Core\Type\FormType">
59-
<argument type="service" id="property_accessor"/>
61+
<argument type="service" id="form.property_accessor" />
6062
<tag name="form.type" alias="form" />
6163
</service>
6264
<service id="form.type.birthday" class="Symfony\Component\Form\Extension\Core\Type\BirthdayType">

Resources/config/serializer.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@
1717
<argument type="collection" />
1818
</service>
1919

20+
<service id="serializer.property_accessor" alias="property_accessor" public="false" />
21+
2022
<!-- Normalizer -->
2123
<service id="serializer.normalizer.object" class="Symfony\Component\Serializer\Normalizer\ObjectNormalizer" public="false">
2224
<argument type="service" id="serializer.mapping.class_metadata_factory" />
25+
<argument>null</argument>
26+
<argument type="service" id="serializer.property_accessor" />
2327

2428
<!-- Run after all custom serializers -->
2529
<tag name="serializer.normalizer" priority="-1000" />

0 commit comments

Comments
 (0)