property_info.php 2.5 KB

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