Skip to content

Commit e8b32ea

Browse files
artyuumfabpot
authored andcommitted
Add "composer require..." in all exception messages when needed
1 parent 5dc5cf5 commit e8b32ea

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

Controller/TemplateController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(Environment $twig = null)
4343
public function templateAction(string $template, int $maxAge = null, int $sharedAge = null, bool $private = null, array $context = [], int $statusCode = 200): Response
4444
{
4545
if (null === $this->twig) {
46-
throw new \LogicException('You cannot use the TemplateController if the Twig Bundle is not available.');
46+
throw new \LogicException('You cannot use the TemplateController if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
4747
}
4848

4949
$response = new Response($this->twig->render($template, $context), $statusCode);

KernelBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function enableReboot()
114114
public function loginUser(object $user, string $firewallContext = 'main'): static
115115
{
116116
if (!interface_exists(UserInterface::class)) {
117-
throw new \LogicException(sprintf('"%s" requires symfony/security-core to be installed.', __METHOD__));
117+
throw new \LogicException(sprintf('"%s" requires symfony/security-core to be installed. Try running "composer require symfony/security-core".', __METHOD__));
118118
}
119119

120120
if (!$user instanceof UserInterface) {

Tests/Controller/TemplateControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testTwig()
3535
public function testNoTwig()
3636
{
3737
$this->expectException(\LogicException::class);
38-
$this->expectExceptionMessage('You cannot use the TemplateController if the Twig Bundle is not available.');
38+
$this->expectExceptionMessage('You cannot use the TemplateController if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
3939
$controller = new TemplateController();
4040

4141
$controller->templateAction('mytemplate')->getContent();

composer.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,6 @@
101101
"symfony/web-profiler-bundle": "<5.4",
102102
"symfony/workflow": "<5.4"
103103
},
104-
"suggest": {
105-
"ext-apcu": "For best performance of the system caches",
106-
"symfony/console": "For using the console commands",
107-
"symfony/form": "For using forms",
108-
"symfony/serializer": "For using the serializer service",
109-
"symfony/validator": "For using validation",
110-
"symfony/yaml": "For using the debug:config and lint:yaml commands",
111-
"symfony/property-info": "For using the property_info service",
112-
"symfony/web-link": "For using web links, features such as preloading, prefetching or prerendering"
113-
},
114104
"autoload": {
115105
"psr-4": { "Symfony\\Bundle\\FrameworkBundle\\": "" },
116106
"exclude-from-classmap": [

0 commit comments

Comments
 (0)