Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0f13584

Browse filesBrowse files
committed
adding checks for the expression language
1 parent 38ddcef commit 0f13584
Copy full SHA for 0f13584

File tree

2 files changed

+8
-0
lines changed
Filter options

2 files changed

+8
-0
lines changed

‎src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
488488
$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior);
489489
break;
490490
case 'expression':
491+
if (!class_exists(Expression::class)) {
492+
throw new \LogicException(sprintf('type="expression" cannot be used without the expression component. Try running "composer require symfony/expression-language".'));
493+
}
494+
491495
$arguments[$key] = new Expression($arg->nodeValue);
492496
break;
493497
case 'collection':

‎src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,10 @@ private function resolveServices($value, $file, $isParameter = false)
727727
$value[$k] = $this->resolveServices($v, $file, $isParameter);
728728
}
729729
} elseif (is_string($value) && 0 === strpos($value, '@=')) {
730+
if (!class_exists(Expression::class)) {
731+
throw new \LogicException(sprintf('The @= expression syntax cannot be used without the expression component. Try running "composer require symfony/expression-language".'));
732+
}
733+
730734
return new Expression(substr($value, 2));
731735
} elseif (is_string($value) && 0 === strpos($value, '@')) {
732736
if (0 === strpos($value, '@@')) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.