Skip to content

Commit 1177ceb

Browse files
WebMambafabpot
authored andcommitted
Throw error with debug message when ExpressionLanguage Component is not installed
1 parent d645703 commit 1177ceb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Constraints/ExpressionLanguageSyntaxValidator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class ExpressionLanguageSyntaxValidator extends ConstraintValidator
2727

2828
public function __construct(ExpressionLanguage $expressionLanguage = null)
2929
{
30+
if (!class_exists(ExpressionLanguage::class)) {
31+
throw new \LogicException(sprintf('The "%s" class requires the "ExpressionLanguage" component. Try running "composer require symfony/expression-language".', self::class));
32+
}
33+
3034
$this->expressionLanguage = $expressionLanguage;
3135
}
3236

0 commit comments

Comments
 (0)