mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
fixed Twig_Node_Filter::__toString()
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user