Skip to content

Commit 75b21e9

Browse files
committed
Throw an exception is expression language is not installed
1 parent c927c48 commit 75b21e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
1515
use Symfony\Component\DependencyInjection\ContainerInterface;
1616
use Symfony\Component\DependencyInjection\Definition;
17+
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
1718
use Symfony\Component\DependencyInjection\ExpressionLanguage;
1819
use Symfony\Component\DependencyInjection\Reference;
1920
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -155,6 +156,10 @@ private function getDefinitionId($id)
155156
private function getExpressionLanguage()
156157
{
157158
if (null === $this->expressionLanguage) {
159+
if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
160+
throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
161+
}
162+
158163
$providers = $this->container->getExpressionLanguageProviders();
159164
$this->expressionLanguage = new ExpressionLanguage(null, $providers, function ($arg) {
160165
if ('""' === substr_replace($arg, '', 1, -1)) {

0 commit comments

Comments
 (0)