8000 minor #28867 [FWBundle] Uniformize errors when a component is missing… · symfony/symfony@dc11f7b · GitHub
[go: up one dir, main page]

Skip to content

Commit dc11f7b

Browse files
committed
minor #28867 [FWBundle] Uniformize errors when a component is missing (dunglas)
This PR was merged into the 3.4 branch. Discussion ---------- [FWBundle] Uniformize errors when a component is missing | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- fa3da4e [FWBundle] Uniformize errors when a component is missing
2 parents 2caee94 + fa3da4e commit dc11f7b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function load(array $configs, ContainerBuilder $container)
182182
// translator will be used and everything will still work as expected.
183183
if ($this->isConfigEnabled($container, $config['translator']) || $this->isConfigEnabled($container, $config['form']) || $this->isConfigEnabled($container, $config['validation'])) {
184184
if (!class_exists('Symfony\Component\Translation\Translator') && $this->isConfigEnabled($container, $config['translator'])) {
185-
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed.');
185+
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed. Try running "composer require symfony/translation".');
186186
}
187187

188188
if (class_exists(Translator::class)) {
@@ -241,7 +241,7 @@ public function load(array $configs, ContainerBuilder $container)
241241

242242
if ($this->isConfigEnabled($container, $config['form'])) {
243243
if (!class_exists('Symfony\Component\Form\Form')) {
244-
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
244+
throw new LogicException('Form support cannot be enabled as the Form component is not installed. Try running "composer require symfony/form".');
245245
}
246246

247247
$this->formConfigEnabled = true;
@@ -261,15 +261,15 @@ public function load(array $configs, ContainerBuilder $container)
261261

262262
if ($this->isConfigEnabled($container, $config['assets'])) {
263263
if (!class_exists('Symfony\Component\Asset\Package')) {
264-
throw new LogicException('Asset support cannot be enabled as the Asset component is not installed.');
264+
throw new LogicException('Asset support cannot be enabled as the Asset component is not installed. Try running "composer require symfony/asset".');
265265
}
266266

267267
$this->registerAssetsConfiguration($config['assets'], $container, $loader);
268268
}
269269

270270
if ($this->isConfigEnabled($container, $config['templating'])) {
271271
if (!class_exists('Symfony\Component\Templating\PhpEngine')) {
272-
throw new LogicException('Templating support cannot be enabled as the Templating component is not installed.');
272+
throw new LogicException('Templating support cannot be enabled as the Templating component is not installed. Try running "composer require symfony/templating".');
273273
}
274274

275275
$this->registerTemplatingConfiguration($config['templating'], $container, $loader);
@@ -290,7 +290,7 @@ public function load(array $configs, ContainerBuilder $container)
290290

291291
if ($this->isConfigEnabled($container, $config['serializer'])) {
292292
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
293-
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
293+
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed. Try running "composer require symfony/serializer-pack".');
294294
}
295295

296296
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
@@ -306,7 +306,7 @@ public function load(array $configs, ContainerBuilder $container)
306306

307307
if ($this->isConfigEnabled($container, $config['web_link'])) {
308308
if (!class_exists(HttpHeaderSerializer::class)) {
309-
throw new LogicException('WebLink support cannot be enabled as the WebLink component is not installed.');
309+
throw new LogicException('WebLink support cannot be enabled as the WebLink component is not installed. Try running "composer require symfony/weblink".');
310310
}
311311

312312
$loader->load('web_link.xml');
@@ -585,7 +585,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
585585
}
586586

587587
if (!class_exists(Workflow\Workflow::class)) {
588-
throw new LogicException('Workflow support cannot be enabled as the Workflow component is not installed.');
588+
throw new LogicException('Workflow support cannot be enabled as the Workflow component is not installed. Try running "composer require symfony/workflow".');
589589
}
590590

591591
$loader->load('workflow.xml');
@@ -688,11 +688,11 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
688688
}
689689

690690
if (!class_exists(ExpressionLanguage::class)) {
691-
throw new LogicException('Cannot guard workflows as the ExpressionLanguage component is not installed.');
691+
throw new LogicException('Cannot guard workflows as the ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
692692
}
693693

694694
if (!class_exists(Security::class)) {
695-
throw new LogicException('Cannot guard workflows as the Security component is not installed.');
695+
throw new LogicException('Cannot guard workflows as the Security component is not installed. Try running "composer require symfony/security".');
696696
}
697697

698698
$eventName = sprintf('workflow.%s.guard.%s', $name, $transitionName);
@@ -1224,7 +1224,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
12241224
}
12251225

12261226
if (!class_exists('Symfony\Component\Validator\Validation')) {
1227-
throw new LogicException('Validation support cannot be enabled as the Validator component is not installed.');
1227+
throw new LogicException('Validation support cannot be enabled as the Validator component is not installed. Try running "composer require symfony/validator".');
12281228
}
12291229

12301230
$loader->load('validator.xml');

0 commit comments

Comments
 (0)
0