[ExpressionLanguage] throw exception when parameters contain expressions

This commit is contained in:
Abdellatif AitBoudad 2013-12-04 21:23:04 +00:00
parent a20b9a4103
commit ca123bc7af

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);
}