8000 bug #25094 [FrameworkBundle][DX] Display a nice error message if an e… · symfony/symfony@f0270a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit f0270a8

Browse files
bug #25094 [FrameworkBundle][DX] Display a nice error message if an enabled component is missing (derrabus)
This PR was merged into the 3.3 branch. Discussion ---------- [FrameworkBundle][DX] Display a nice error message if an enabled component is missing | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25093 | License | MIT | Doc PR | N/A Commits ------- 2b45805 Display a nice error message if the form/serializer component is missing.
2 parents 20dd47b + 2b45805 commit f0270a8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ public function load(array $configs, ContainerBuilder $container)
171171
}
172172

173173
if ($this->isConfigEnabled($container, $config['form'])) {
174+
if (!class_exists('Symfony\Component\Form\Form')) {
175+
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
176+
}
177+
174178
$this->formConfigEnabled = true;
175179
$this->registerFormConfiguration($config, $container, $loader);
176180
$config['validation']['enabled'] = true;
@@ -216,6 +220,10 @@ public function load(array $configs, ContainerBuilder $container)
216220
$this->registerPropertyAccessConfiguration($config['property_access'], $container, $loader);
217221

218222
if ($this->isConfigEnabled($container, $config['serializer'])) {
223+
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
224+
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
225+
}
226+
219227
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
220228
}
221229

0 commit comments

Comments
 (0)
0