Skip to content

Commit ca123bc

Browse files
committed
[ExpressionLanguage] throw exception when parameters contain expressions
1 parent a20b9a4 commit ca123bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

+2
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,8 @@ private function exportParameters($parameters, $path = '', $indent = 12)
980980
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain service definitions. Definition for "%s" found in "%s".', $value->getClass(), $path.'/'.$key));
981981
} elseif ($value instanceof Reference) {
982982
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path.'/'.$key));
983+
} elseif ($value instanceof Expression) {
984+
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key));
983985
} else {
984986
$value = var_export($value, true);
985987
}

0 commit comments

Comments
 (0)