fixed Twig_Node_Filter::__toString()

This commit is contained in:
Fabien Potencier
2010-05-06 08:21:17 +02:00
parent b030645847
commit 9bc1acbc23
2 changed files with 17 additions and 3 deletions
+1 -2
View File
@@ -30,14 +30,13 @@ class Twig_Node_Expression_Filter extends Twig_Node_Expression implements Twig_N
$filters[] = $filter[0].'('.implode(', ', $filter[1]).')';
}
$repr = array(get_class($this).'(');
$repr = array(get_class($this).'('.implode(', ', $filters));
foreach (explode("\n", $this->node->__toString()) as $line)
{
$repr[] = ' '.$line;
}
$repr[] = ' ('.implode(', ', $filters).')';
$repr[] = ')';
return implode("\n", $repr);
+16 -1
View File
@@ -30,7 +30,22 @@ class Twig_Node_Filter extends Twig_Node implements Twig_NodeListInterface
public function __toString()
{
return get_class($this).'('.$this->filters.')';
$filters = array();
foreach ($this->filters as $filter)
{
$filters[] = $filter[0].'('.implode(', ', $filter[1]).')';
}
$repr = array(get_class($this).'('.implode(', ', $filters));
foreach (explode("\n", $this->body->__toString()) as $line)
{
$repr[] = ' '.$line;
}
$repr[] = ')';
return implode("\n", $repr);
}
public function getNodes()