Skip to content

Commit b07b38d

Browse files
artyuumfabpot
authored andcommitted
Add "composer require..." in all exception messages when needed
1 parent 96112c1 commit b07b38d

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

Matcher/Dumper/CompiledUrlMatcherDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ private function getExpressionLanguage(): ExpressionLanguage
447447
{
448448
if (!isset($this->expressionLanguage)) {
449449
if (!class_exists(ExpressionLanguage::class)) {
450-
throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
450+
throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
451451
}
452452
$this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders);
453453
}

Matcher/UrlMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ protected function getExpressionLanguage()
259259
{
260260
if (null === $this->expressionLanguage) {
261261
if (!class_exists(ExpressionLanguage::class)) {
262-
throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
262+
throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
263263
}
264264
$this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders);
265265
}

composer.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@
3333
"symfony/dependency-injection": "<5.4",
3434
"symfony/yaml": "<5.4"
3535
},
36-
"suggest": {
37-
"symfony/http-foundation": "For using a Symfony Request object",
38-
"symfony/config": "For using the all-in-one router or any loader",
39-
"symfony/yaml": "For using the YAML loader",
40-
"symfony/expression-language": "For using expression matching"
41-
},
4236
"autoload": {
4337
"psr-4": { "Symfony\\Component\\Routing\\": "" },
4438
"exclude-from-classmap": [

0 commit comments

Comments
 (0)