8000 [FWBundle] Uniformize errors when a component is missing by dunglas · Pull Request #28867 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FWBundle] Uniformize errors when a component is missing #28867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function load(array $configs, ContainerBuilder $container)
// translator will be used and everything will still work as expected.
if ($this->isConfigEnabled($container, $config['translator']) || $this->isConfigEnabled($container, $config['form']) || $this->isConfigEnabled($container, $config['validation'])) {
if (!class_exists('Symfony\Component\Translation\Translator') && $this->isConfigEnabled($container, $config['translator'])) {
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed.');
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed. Try running "composer require symfony/translation".');
}

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

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.');
throw new LogicException('Form support cannot be enabled as the Form component is not installed. Try running "composer require symfony/form".');
}

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

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

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

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

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

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.');
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed. Try running "composer require symfony/serializer-pack".');
}

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

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

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

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

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

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

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

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

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

$loader->load('validator.xml');
Expand Down
0