|
135 | 135 | use Symfony\Component\Notifier\Transport\TransportFactoryInterface as NotifierTransportFactoryInterface;
|
136 | 136 | use Symfony\Component\Process\Messenger\RunProcessMessageHandler;
|
137 | 137 | use Symfony\Component\PropertyAccess\PropertyAccessor;
|
| 138 | +use Symfony\Component\PropertyInfo\Extractor\ConstructorArgumentTypeExtractorInterface; |
138 | 139 | use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
|
139 | 140 | use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor;
|
140 | 141 | use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
|
@@ -427,7 +428,7 @@ public function load(array $configs, ContainerBuilder $container): void
|
427 | 428 | }
|
428 | 429 |
|
429 | 430 | if ($propertyInfoEnabled) {
|
430 |
| - $this->registerPropertyInfoConfiguration($container, $loader); |
| 431 | + $this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader); |
431 | 432 | }
|
432 | 433 |
|
433 | 434 | if ($this->readConfigEnabled('json_encoder', $container, $config['json_encoder'])) {
|
@@ -657,6 +658,8 @@ public function load(array $configs, ContainerBuilder $container): void
|
657 | 658 | ->addTag('property_info.list_extractor');
|
658 | 659 | $container->registerForAutoconfiguration(PropertyTypeExtractorInterface::class)
|
659 | 660 | ->addTag('property_info.type_extractor');
|
| 661 | + $container->registerForAutoconfiguration(ConstructorArgumentTypeExtractorInterface::class) |
| 662 | + ->addTag('property_info.constructor_extractor'); |
660 | 663 | $container->registerForAutoconfiguration(PropertyDescriptionExtractorInterface::class)
|
661 | 664 | ->addTag('property_info.description_extractor');
|
662 | 665 | $container->registerForAutoconfiguration(PropertyAccessExtractorInterface::class)
|
@@ -2040,26 +2043,32 @@ private function registerJsonEncoderConfiguration(array $config, ContainerBuilde
|
2040 | 2043 | }
|
2041 | 2044 | }
|
2042 | 2045 |
|
2043 |
| - private function registerPropertyInfoConfiguration(ContainerBuilder $container, PhpFileLoader $loader): void |
| 2046 | + private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void |
2044 | 2047 | {
|
2045 | 2048 | if (!interface_exists(PropertyInfoExtractorInterface::class)) {
|
2046 | 2049 | throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".');
|
2047 | 2050 | }
|
2048 | 2051 |
|
2049 | 2052 | $loader->load('property_info.php');
|
2050 | 2053 |
|
| 2054 | + if (!$config['with_constructor_extractor']) { |
| 2055 | + $container->removeDefinition('property_info.constructor_extractor'); |
<
10000
tr class="diff-line-row">
| 2056 | + } |
| 2057 | + |
2051 | 2058 | if (
|
2052 | 2059 | ContainerBuilder::willBeAvailable('phpstan/phpdoc-parser', PhpDocParser::class, ['symfony/framework-bundle', 'symfony/property-info'])
|
2053 | 2060 | && ContainerBuilder::willBeAvailable('phpdocumentor/type-resolver', ContextFactory::class, ['symfony/framework-bundle', 'symfony/property-info'])
|
2054 | 2061 | ) {
|
2055 | 2062 | $definition = $container->register('property_info.phpstan_extractor', PhpStanExtractor::class);
|
2056 | 2063 | $definition->addTag('property_info.type_extractor', ['priority' => -1000]);
|
| 2064 | + $definition->addTag('property_info.constructor_extractor', ['priority' => -1000]); |
2057 | 2065 | }
|
2058 | 2066 |
|
2059 | 2067 | if (ContainerBuilder::willBeAvailable('phpdocumentor/reflection-docblock', DocBlockFactoryInterface::class, ['symfony/framework-bundle', 'symfony/property-info'], true)) {
|
2060 | 2068 | $definition = $container->register('property_info.php_doc_extractor', PhpDocExtractor::class);
|
2061 | 2069 | $definition->addTag('property_info.description_extractor', ['priority' => -1000]);
|
2062 | 2070 | $definition->addTag('property_info.type_extractor', ['priority' => -1001]);
|
| 2071 | + $definition->addTag('property_info.constructor_extractor', ['priority' => -1001]); |
2063 | 2072 | }
|
2064 | 2073 |
|
2065 | 2074 | if ($container->getParameter('kernel.debug')) {
|
|
0 commit comments