[ExpressionLanguage] Fixed exception message

This commit is contained in:
Ahmed TAILOULOUTE 2020-02-28 11:19:56 +01:00
parent 421c7f8fcd
commit 4d695b380d

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