8000 [FWBundle] Throw if PropertyInfo is enabled, but the component isn't … · symfony/symfony@41fd0a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41fd0a8

Browse files
committed
[FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed
1 parent 44ce4dd commit 41fd0a8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
use Symfony\Component\PropertyAccess\PropertyAccessor;
6262
use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
6363
use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
64+
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
6465
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
6566
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
6667
use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
@@ -296,7 +297,7 @@ public function load(array $configs, ContainerBuilder $container)
296297
}
297298

298299
if ($this->isConfigEnabled($container, $config['property_info'])) {
299-
$this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader);
300+
$this->registerPropertyInfoConfiguration($container, $loader);
300301
}
301302

302303
if ($this->isConfigEnabled($container, $config['lock'])) {
@@ -1543,8 +1544,12 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
15431544
}
15441545
}
15451546

1546-
private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
1547+
private function registerPropertyInfoConfiguration(ContainerBuilder $container, XmlFileLoader $loader)
15471548
{
1549+
if (!interface_exists(PropertyInfoExtractorInterface::class)) {
1550+
throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".');
1551+
}
1552+
15481553
$loader->load('property_info.xml');
15491554

15501555
$container->getDefinition('property_info')->setPrivate(true);

0 commit comments

Comments
 (0)
0