|
129 | 129 | use Symfony\Component\Notifier\TexterInterface;
|
130 | 130 | use Symfony\Component\Notifier\Transport\TransportFactoryInterface as NotifierTransportFactoryInterface;
|
131 | 131 | use Symfony\Component\PropertyAccess\PropertyAccessor;
|
| 132 | +use Symfony\Component\PropertyInfo\Extractor\ConstructorArgumentTypeExtractorInterface; |
132 | 133 | use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
|
133 | 134 | use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor;
|
134 | 135 | use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
|
@@ -390,7 +391,7 @@ public function load(array $configs, ContainerBuilder $container)
|
390 | 391 | }
|
391 | 392 |
|
392 | 393 | if ($propertyInfoEnabled) {
|
393 |
| - $this->registerPropertyInfoConfiguration($container, $loader); |
| 394 | + $this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader); |
394 | 395 | }
|
395 | 396 |
|
396 | 397 | if ($this->readConfigEnabled('lock', $container, $config['lock'])) {
|
@@ -631,6 +632,8 @@ public function load(array $configs, ContainerBuilder $container)
|
631 | 632 | ->addTag('property_info.list_extractor');
|
632 | 633 | $container->registerForAutoconfiguration(PropertyTypeExtractorInterface::class)
|
633 | 634 | ->addTag('property_info.type_extractor');
|
| 635 | + $container->registerForAutoconfiguration(ConstructorArgumentTypeExtractorInterface::class) |
| 636 | + ->addTag('property_info.constructor_extractor'); |
634 | 637 | $container->registerForAutoconfiguration(PropertyDescriptionExtractorInterface::class)
|
635 | 638 | ->addTag('property_info.description_extractor');
|
636 | 639 | $container->registerForAutoconfiguration(PropertyAccessExtractorInterface::class)
|
@@ -1942,26 +1945,32 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
|
1942 | 1945 | }
|
1943 | 1946 | }
|
1944 | 1947 |
|
1945 |
| - private function registerPropertyInfoConfiguration(ContainerBuilder $container, PhpFileLoader $loader): void |
| 1948 | + private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void |
1946 | 1949 | {
|
1947 | 1950 | if (!interface_exists(PropertyInfoExtractorInterface::class)) {
|
1948 | 1951 | throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".');
|
1949 | 1952 | }
|
1950 | 1953 |
|
1951 | 1954 | $loader->load('property_info.php');
|
1952 | 1955 |
|
| 1956 | + if (!$config['with_constructor_extractor']) { |
| 1957 | + $container->removeDefinition('property_info.constructor_extractor'); |
| 1958 | + } |
| 1959 | + |
1953 | 1960 | if (
|
1954 | 1961 | ContainerBuilder::willBeAvailable('phpstan/phpdoc-parser', PhpDocParser::class, ['symfony/framework-bundle', 'symfony/property-info'])
|
1955 | 1962 | && ContainerBuilder::willBeAvailable('phpdocumentor/type-resolver', ContextFactory::class, ['symfony/framework-bundle', 'symfony/property-info'])
|
1956 | 1963 | ) {
|
1957 | 1964 | $definition = $container->register('property_info.phpstan_extractor', PhpStanExtractor::class);
|
1958 | 1965 | $definition->addTag('property_info.type_extractor', ['priority' => -1000]);
|
| 1966 | + $definition->addTag('property_info.constructor_extractor', ['priority' => -1000]); |
1959 | 1967 | }
|
1960 | 1968 |
|
1961 | 1969 | if (ContainerBuilder::willBeAvailable('phpdocumentor/reflection-docblock', DocBlockFactoryInterface::class, ['symfony/framework-bundle', 'symfony/property-info'], true)) {
|
1962 | 1970 | $definition = $container->register('property_info.php_doc_extractor', PhpDocExtractor::class);
|
1963 | 1971 | $definition->addTag('property_info.description_extractor', ['priority' => -1000]);
|
1964 | 1972 | $definition->addTag('property_info.type_extractor', ['priority' => -1001]);
|
| 1973 | + $definition->addTag('property_info.constructor_extractor', ['priority' => -1001]); |
1965 | 1974 | }
|
1966 | 1975 |
|
1967 | 1976 | if ($container->getParameter('kernel.debug')) {
|
|
0 commit comments