|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Component\DependencyInjection\Loader\Configurator; |
| 13 | + |
| 14 | +use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; |
| 15 | +use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface; |
| 16 | +use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface; |
| 17 | +use Symfony\Component\PropertyInfo\PropertyInfoCacheExtractor; |
| 18 | +use Symfony\Component\PropertyInfo\PropertyInfoExtractor; |
| 19 | +use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface; |
| 20 | +use Symfony\Component\PropertyInfo\PropertyInitializableExtractorInterface; |
| 21 | +use Symfony\Component\PropertyInfo\PropertyListExtractorInterface; |
| 22 | +use Symfony\Component\PropertyInfo\PropertyReadInfoExtractorInterface; |
| 23 | +use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; |
| 24 | +use Symfony\Component\PropertyInfo\PropertyWriteInfoExtractorInterface; |
| 25 | + |
| 26 | +return static function (ContainerConfigurator $container) { |
| 27 | + $container->services() |
| 28 | + ->set('property_info', PropertyInfoExtractor::class) |
| 29 | + ->args([[], [], [], [], []]) |
| 30 | + |
| 31 | + ->alias(PropertyAccessExtractorInterface::class, 'property_info') |
| 32 | + ->alias(PropertyDescriptionExtractorInterface::class, 'property_info') |
| 33 | + ->alias(PropertyInfoExtractorInterface::class, 'property_info') |
| 34 | + ->alias(PropertyTypeExtractorInterface::class, 'property_info') |
| 35 | + ->alias(PropertyListExtractorInterface::class, 'property_info') |
| 36 | + ->alias(PropertyInitializableExtractorInterface::class, 'property_info') |
| 37 | + |
| 38 | + ->set('property_info.cache', PropertyInfoCacheExtractor::class) |
| 39 | + ->decorate('property_info') |
| 40 | + ->args([service('property_info.cache.inner'), service('cache.property_info')]) |
| 41 | + |
| 42 | + // Extractor |
| 43 | + ->set('property_info.reflection_extractor', ReflectionExtractor::class) |
| 44 | + ->tag('property_info.list_extractor', ['priority' => -1000]) |
| 45 | + ->tag('property_info.type_extractor', ['priority' => -1002]) |
| 46 | + ->tag('property_info.access_extractor', ['priority' => -1000]) |
| 47 | + ->tag('property_info.initializable_extractor', ['priority' => -1000]) |
| 48 | + |
| 49 | + ->alias(PropertyReadInfoExtractorInterface::class, 'property_info.reflection_extractor') |
| 50 | + ->alias(PropertyWriteInfoExtractorInterface::class, 'property_info.reflection_extractor') |
| 51 | + ; |
| 52 | +}; |
0 commit comments