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:
commit
0888ff6dbd
@ -80,7 +80,7 @@ class GetAttrNode extends Node
|
|||||||
case self::METHOD_CALL:
|
case self::METHOD_CALL:
|
||||||
$obj = $this->nodes['node']->evaluate($functions, $values);
|
$obj = $this->nodes['node']->evaluate($functions, $values);
|
||||||
if (!\is_object($obj)) {
|
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']])) {
|
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)));
|
throw new \RuntimeException(sprintf('Unable to call method "%s" of object "%s".', $this->nodes['attribute']->attributes['value'], \get_class($obj)));
|
||||||
|
Reference in New Issue
Block a user