Skip to content

Commit 3736bf6

Browse files
committed
bug #28688 [FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed (dunglas)
This PR was merged into the 3.4 branch. Discussion ---------- [FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? |no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 41fd0a881e [FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed
2 parents 0a308d8 + a9303a3 commit 3736bf6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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'])) {
@@ -1545,8 +1546,12 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
15451546
}
15461547
}
15471548

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

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

0 commit comments

Comments
 (0)