From e2f8adb86aea1005c716d9abb1395a34267bec94 Mon Sep 17 00:00:00 2001 From: fabien Date: Sun, 13 Dec 2009 08:47:28 +0000 Subject: [PATCH] added __toString() to Node_Set git-svn-id: http://svn.twig-project.org/trunk@159 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- lib/Twig/Node/Set.php | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/lib/Twig/Node/Set.php b/lib/Twig/Node/Set.php index 0d367c6..767f567 100644 --- a/lib/Twig/Node/Set.php +++ b/lib/Twig/Node/Set.php @@ -15,6 +15,21 @@ class Twig_Node_Set extends Twig_Node $this->values = $values; } + public function __toString() + { + $repr = array(get_class($this).'('.($this->isMultitarget ? implode(', ', $this->names) : $this->names).','); + foreach ($this->isMultitarget ? $this->values : array($this->values) as $node) + { + foreach (explode("\n", $node->__toString()) as $line) + { + $repr[] = ' '.$line; + } + } + $repr[] = ')'; + + return implode("\n", $repr); + } + public function compile($compiler) { $compiler->addDebugInfo($this); -- 1.7.2.5