Skip to content

Commit d4eaa04

Browse files
artyuumfabpot
authored andcommitted
Add "composer require..." in all exception messages when needed
1 parent 460abf9 commit d4eaa04

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ private function getExpressionLanguage(): ExpressionLanguage
21552155
{
21562156
if (!isset($this->expressionLanguage)) {
21572157
if (!class_exists(\Symfony\Component\ExpressionLanguage\ExpressionLanguage::class)) {
2158-
throw new LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
2158+
throw new LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
21592159
}
21602160
$providers = $this->container->getExpressionLanguageProviders();
21612161
$this->expressionLanguage = new ExpressionLanguage(null, $providers, function ($arg) {

Dumper/YamlDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class YamlDumper extends Dumper
4545
public function dump(array $options = []): string
4646
{
4747
if (!class_exists(YmlDumper::class)) {
48-
throw new LogicException('Unable to dump the container as the Symfony Yaml Component is not installed.');
48+
throw new LogicException('Unable to dump the container as the Symfony Yaml Component is not installed. Try running "composer require symfony/yaml".');
4949
}
5050

5151
$this->dumper ??= new YmlDumper();

Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ private function parseCallable(mixed $callable, string $parameter, string $id, s
759759
protected function loadFile(string $file): ?array
760760
{
761761
if (!class_exists(\Symfony\Component\Yaml\Parser::class)) {
762-
throw new RuntimeException('Unable to load YAML config files as the Symfony Yaml Component is not installed.');
762+
throw new RuntimeException('Unable to load YAML config files as the Symfony Yaml Component is not installed. Try running "composer require symfony/yaml".');
763763
}
764764

765765
if (!stream_is_local($file)) {

composer.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
"symfony/config": "^6.1",
2828
"symfony/expression-language": "^5.4|^6.0"
2929
},
30-
"suggest": {
31-
"symfony/yaml": "",
32-
"symfony/config": "",
33-
"symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
34-
"symfony/expression-language": "For using expressions in service container configuration"
35-
},
3630
"conflict": {
3731
"ext-psr": "<1.1|>=2",
3832
"symfony/config": "<6.1",

0 commit comments

Comments
 (0)