Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e31badc

Browse filesBrowse files
committed
Display a nice error message if the form/serializer component is missing.
1 parent 232df2b commit e31badc
Copy full SHA for e31badc

File tree

1 file changed

+8
-0
lines changed
Filter options

1 file changed

+8
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ public function load(array $configs, ContainerBuilder $container)
232232
}
233233

234234
if ($this->isConfigEnabled($container, $config['form'])) {
235+
if (!class_exists('Symfony\Component\Form\Form')) {
236+
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
237+
}
238+
235239
$this->formConfigEnabled = true;
236240
$this->registerFormConfiguration($config, $container, $loader);
237241

@@ -1422,6 +1426,10 @@ private function registerSecurityCsrfConfiguration(array $config, ContainerBuild
14221426

14231427
private function registerSerializerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
14241428
{
1429+
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
1430+
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
1431+
}
1432+
14251433
$loader->load('serializer.xml');
14261434

14271435
if (!class_exists(DateIntervalNormalizer::class)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.