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.
This commit is contained in:
commit
f0270a891e
@ -171,6 +171,10 @@ class FrameworkExtension extends Extension
|
||||
}
|
||||
|
||||
if ($this->isConfigEnabled($container, $config['form'])) {
|
||||
if (!class_exists('Symfony\Component\Form\Form')) {
|
||||
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
|
||||
}
|
||||
|
||||
$this->formConfigEnabled = true;
|
||||
$this->registerFormConfiguration($config, $container, $loader);
|
||||
$config['validation']['enabled'] = true;
|
||||
@ -216,6 +220,10 @@ class FrameworkExtension extends Extension
|
||||
$this->registerPropertyAccessConfiguration($config['property_access'], $container, $loader);
|
||||
|
||||
if ($this->isConfigEnabled($container, $config['serializer'])) {
|
||||
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
|
||||
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
|
||||
}
|
||||
|
||||
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user