minor #35894 [ExpressionLanguage] Fixed exception message (atailouloute)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[ExpressionLanguage] Fixed exception message

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

4d695b380d [ExpressionLanguage] Fixed exception message
This commit is contained in:
Fabien Potencier 2020-02-29 11:02:13 +01:00
commit 0888ff6dbd

View File

@ -80,7 +80,7 @@ class GetAttrNode extends Node
case self::METHOD_CALL:
$obj = $this->nodes['node']->evaluate($functions, $values);
if (!\is_object($obj)) {
throw new \RuntimeException('Unable to get a property on a non-object.');
throw new \RuntimeException('Unable to call method of a non-object.');
}
if (!\is_callable($toCall = [$obj, $this->nodes['attribute']->attributes['value']])) {
throw new \RuntimeException(sprintf('Unable to call method "%s" of object "%s".', $this->nodes['attribute']->attributes['value'], \get_class($obj)));