|
127 | 127 | use Symfony\Component\Notifier\Transport\TransportFactoryInterface as NotifierTransportFactoryInterface;
|
128 | 128 | use Symfony\Component\Process\Messenger\RunProcessMessageHandler;
|
129 | 129 | use Symfony\Component\PropertyAccess\PropertyAccessor;
|
| 130 | +use Symfony\Component\PropertyInfo\Extractor\ConstructorArgumentTypeExtractorInterface; |
130 | 131 | use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
|
131 | 132 | use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor;
|
132 | 133 | use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
|
@@ -405,7 +406,7 @@ public function load(array $configs, ContainerBuilder $container): void
|
405 | 406 | }
|
406 | 407 |
|
407 | 408 | if ($propertyInfoEnabled) {
|
408 |
| - $this->registerPropertyInfoConfiguration($container, $loader); |
| 409 | + $this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader); |
409 | 410 | }
|
410 | 411 |
|
411 | 412 | if ($this->readConfigEnabled('lock', $container, $config['lock'])) {
|
@@ -637,6 +638,8 @@ public function load(array $configs, ContainerBuilder $container): void
|
637 | 638 | ->addTag('property_info.list_extractor');
|
638 | 639 | $container->registerForAutoconfiguration(PropertyTypeExtractorInterface::class)
|
639 | 640 | ->addTag('property_info.type_extractor');
|
| 641 | + $container->registerForAutoconfiguration(ConstructorArgumentTypeExtractorInterface::class) |
| 642 | + ->addTag('property_info.constructor_extractor'); |
640 | 643 | $container->registerForAutoconfiguration(PropertyDescriptionExtractorInterface::class)
|
641 | 644 | ->addTag('property_info.description_extractor');
|
642 | 645 | $container->registerForAutoconfiguration(PropertyAccessExtractorInterface::class)
|
@@ -1937,26 +1940,32 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
|
1937 | 1940 | $container->getDefinition('serializer.normalizer.property')->setArgument(5, $defaultContext);
|
1938 | 1941 | }
|
1939 | 1942 |
|
1940 |
| - private function registerPropertyInfoConfiguration(ContainerBuilder $container, PhpFileLoader $loader): void |
| 1943 | + private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void |
1941 | 1944 | {
|
1942 | 1945 | if (!interface_exists(PropertyInfoExtractorInterface::class)) {
|
1943 | 1946 | throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".');
|
1944 | 1947 | }
|
1945 | 1948 |
|
1946 | 1949 | $loader->load('property_info.php');
|
1947 | 1950 |
|
| 1951 | + if (!$config['with_constructor_extractor']) { |
| 1952 | + $container->removeDefinition('property_info.constructor_extractor'); |
| 1953 | + } |
| 1954 | + |
1948 | 1955 | if (
|
1949 | 1956 | ContainerBuilder::willBeAvailable('phpstan/phpdoc-parser', PhpDocParser::class, ['symfony/framework-bundle', 'symfony/property-info'])
|
1950 | 1957 | && ContainerBuilder::willBeAvailable('phpdocumentor/type-resolver', ContextFactory::class, ['symfony/framework-bundle', 'symfony/property-info'])
|
1951 | 1958 | ) {
|
1952 | 1959 | $definition = $container->register('property_info.phpstan_extractor', PhpStanExtractor::class);
|
1953 | 1960 | $definition->addTag('property_info.type_extractor', ['priority' => -1000]);
|
| 1961 | + $definition->addTag('property_info.constructor_extractor', ['priority' => -1000]); |
1954 | 1962 | }
|
1955 | 1963 |
|
1956 | 1964 | if (ContainerBuilder::willBeAvailable('phpdocumentor/reflection-docblock', DocBlockFactoryInterface::class, ['symfony/framework-bundle', 'symfony/property-info'], true)) {
|
1957 | 1965 | $definition = $container->register('property_info.php_doc_extractor', PhpDocExtractor::class);
|
1958 | 1966 | $definition->addTag('property_info.description_extractor', ['priority' => -1000]);
|
1959 | 1967 | $definition->addTag('property_info.type_extractor', ['priority' => -1001]);
|
| 1968 | + $definition->addTag('property_info.constructor_extractor', ['priority' => -1001]); |
1960 | 1969 | }
|
1961 | 1970 |
|
1962 | 1971 | if ($container->getParameter('kernel.debug')) {
|
|
0 commit comments