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 3502020

Browse filesBrowse files
committed
adding checks for the expression language
1 parent f897542 commit 3502020
Copy full SHA for 3502020

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
@@ -506,6 +506,10 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
506506
$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior);
507507
break;
508508
case 'expression':
509+
if (!class_exists(Expression::class)) {
510+
throw new \LogicException(sprintf('The type="expression" attribute cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'));
511+
}
512+
509513
$arguments[$key] = new Expression($arg->nodeValue);
510514
break;
511515
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
@@ -775,6 +775,10 @@ private function resolveServices($value, $file, $isParameter = false)
775775
$value[$k] = $this->resolveServices($v, $file, $isParameter);
776776
}
777777
} elseif (is_string($value) && 0 === strpos($value, '@=')) {
778+
if (!class_exists(Expression::class)) {
779+
throw new \LogicException(sprintf('The "@=" expression syntax cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'));
780+
}
781+
778782
return new Expression(substr($value, 2));
779783
} elseif (is_string($value) && 0 === strpos($value, '@')) {
780784
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.