From a4490975d31855e4b97cd955f40014df7c726c48 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 18 Oct 2012 13:59:31 +0200 Subject: [PATCH] reverted BC break --- lib/Twig/Node/Expression/MethodCall.php | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Twig/Node/Expression/MethodCall.php b/lib/Twig/Node/Expression/MethodCall.php index 2c24c2c..620b02b 100644 --- a/lib/Twig/Node/Expression/MethodCall.php +++ b/lib/Twig/Node/Expression/MethodCall.php @@ -10,15 +10,17 @@ */ class Twig_Node_Expression_MethodCall extends Twig_Node_Expression { - public function __construct(Twig_Node_Expression_Name $node, $method, Twig_Node_Expression_Array $arguments, $lineno) + public function __construct(Twig_Node_Expression $node, $method, Twig_Node_Expression_Array $arguments, $lineno) { parent::__construct(array('node' => $node, 'arguments' => $arguments), array('method' => $method, 'safe' => false), $lineno); + + if ($node instanceof Twig_Node_Expression_Name) { + $node->setAttribute('always_defined', true); + } } public function compile(Twig_Compiler $compiler) { - $this->getNode('node')->setAttribute('always_defined', true); - $compiler ->subcompile($this->getNode('node')) ->raw('->') -- 1.7.2.5