bug #9700 [ExpressionLanguage] throw exception when parameters contain expressions (aitboudad)

This PR was merged into the 2.4 branch.

Discussion
----------

[ExpressionLanguage] throw exception when parameters contain expressions

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9658
| License       | MIT
| Doc PR        | symfony/symfony-docs#3232

Commits
-------

ca123bc [ExpressionLanguage] throw exception when parameters contain expressions
This commit is contained in:
Fabien Potencier 2013-12-12 17:41:50 +01:00
commit b3afa8dda2

View File

@ -980,6 +980,8 @@ EOF;
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));
} elseif ($value instanceof Reference) {
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));
} elseif ($value instanceof Expression) {
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key));
} else {
$value = var_export($value, true);
}