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 fa3da4e

Browse filesBrowse files
committed
[FWBundle] Uniformize errors when a component is missing
1 parent 55978d7 commit fa3da4e
Copy full SHA for fa3da4e

File tree

Expand file treeCollapse file tree

1 file changed

+10
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-10
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+10-10Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.