Skip to content

Commit 7089f49

Browse files
Merge branch '3.3' into 3.4
* 3.3: Display a nice error message if the form/serializer component is missing. Force phpunit-bridge update (bis) [Bridge/PhpUnit] Fix disabling global state preservation
2 parents 369cbb9 + d400883 commit 7089f49

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ public function load(array $configs, ContainerBuilder $container)
178178
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed.');
179179
}
180180

181-
if (!class_exists('Symfony\Component\Translation\Translator') && $this->isConfigEnabled($container, $config['validation'])) {
182-
throw new LogicException('Validation support cannot be enabled as the Translation component is not installed.');
183-
}
184-
185181
if (class_exists(Translator::class)) {
186182
$loader->load('identity_translator.xml');
187183
}
@@ -232,6 +228,10 @@ public function load(array $configs, ContainerBuilder $container)
232228
}
233229

234230
if ($this->isConfigEnabled($container, $config['form'])) {
231+
if (!class_exists('Symfony\Component\Form\Form')) {
232+
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
233+
}
234+
235235
$this->formConfigEnabled = true;
236236
$this->registerFormConfiguration($config, $container, $loader);
237237

@@ -279,6 +279,10 @@ public function load(array $configs, ContainerBuilder $container)
279279
$this->registerPropertyAccessConfiguration($config['property_access'], $container, $loader);
280280

281281
if ($this->isConfigEnabled($container, $config['serializer'])) {
282+
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
283+
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
284+
}
285+
282286
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
283287
}
284288

0 commit comments

Comments
 (0)