Skip to content

Commit 0b4fb7b

Browse files
committed
[FrameworkBundle][PropertyAccess] Use injection for info extractors
1 parent c037525 commit 0b4fb7b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@
108108
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
109109
use Symfony\Component\PropertyInfo\PropertyInitializableExtractorInterface;
110110
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
111+
use Symfony\Component\PropertyInfo\PropertyReadInfoExtractorInterface;
111112
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
113+
use Symfony\Component\PropertyInfo\PropertyWriteInfoExtractorInterface;
112114
use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
113115
use Symfony\Component\Routing\Loader\AnnotationFileLoader;
114116
use Symfony\Component\Security\Core\Security;
@@ -1381,6 +1383,8 @@ private function registerPropertyAccessConfiguration(array $config, ContainerBui
13811383
->replaceArgument(0, $config['magic_call'])
13821384
->replaceArgument(1, $config['throw_exception_on_invalid_index'])
13831385
->replaceArgument(3, $config['throw_exception_on_invalid_property_path'])
1386+
->replaceArgument(4, new Reference(PropertyReadInfoExtractorInterface::class, ContainerInterface::NULL_ON_INVALID_REFERENCE))
1387+
->replaceArgument(5, new Reference(PropertyWriteInfoExtractorInterface::class, ContainerInterface::NULL_ON_INVALID_REFERENCE))
13841388
;
13851389
}
13861390

Resources/config/property_info.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,8 @@
3333
<tag name="property_info.access_extractor" priority="-1000" />
3434
<tag name="property_info.initializable_extractor" priority="-1000" />
3535
</service>
36+
37+
<service id="Symfony\Component\PropertyInfo\PropertyReadInfoExtractorInterface" alias="property_info.reflection_extractor" />
38+
<service id="Symfony\Component\PropertyInfo\PropertyWriteInfoExtractorInterface" alias="property_info.reflection_extractor" />
3639
</services>
3740
</container>

0 commit comments

Comments
 (0)