From b030645847bb7e45ad19775186ef32a1430f11bc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 6 May 2010 08:14:28 +0200 Subject: [PATCH] fixed Twig_Node_Module::__toString() to include information about blocks and macros --- lib/Twig/Node/Module.php | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/Twig/Node/Module.php b/lib/Twig/Node/Module.php index c7cb37a..d22a990 100644 --- a/lib/Twig/Node/Module.php +++ b/lib/Twig/Node/Module.php @@ -42,22 +42,33 @@ class Twig_Node_Module extends Twig_Node implements Twig_NodeListInterface public function __toString() { - $repr = array(get_class($this).'('); + $repr = array(get_class($this).'(', ' body:'); foreach ($this->body->getNodes() as $node) { foreach (explode("\n", $node->__toString()) as $line) { - $repr[] = ' '.$line; + $repr[] = ' '.$line; } } + $repr[] = ' blocks: '; foreach ($this->blocks as $node) { foreach (explode("\n", $node->__toString()) as $line) { - $repr[] = ' '.$line; + $repr[] = ' '.$line; } } + + $repr[] = ' macros: '; + foreach ($this->macros as $node) + { + foreach (explode("\n", $node->__toString()) as $line) + { + $repr[] = ' '.$line; + } + } + $repr[] = ')'; return implode("\n", $repr); -- 1.7.2.5