diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index c36b85cc9a..6b33715ab6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -61,6 +61,7 @@ use Symfony\Component\Lock\StoreInterface; use Symfony\Component\PropertyAccess\PropertyAccessor; use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface; use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface; +use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface; use Symfony\Component\PropertyInfo\PropertyListExtractorInterface; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader; @@ -296,7 +297,7 @@ class FrameworkExtension extends Extension } if ($this->isConfigEnabled($container, $config['property_info'])) { - $this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader); + $this->registerPropertyInfoConfiguration($container, $loader); } if ($this->isConfigEnabled($container, $config['lock'])) { @@ -1543,8 +1544,12 @@ class FrameworkExtension extends Extension } } - private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) + private function registerPropertyInfoConfiguration(ContainerBuilder $container, XmlFileLoader $loader) { + if (!interface_exists(PropertyInfoExtractorInterface::class)) { + throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".'); + } + $loader->load('property_info.xml'); $container->getDefinition('property_info')->setPrivate(true);