From: Fabien Potencier Date: Thu, 6 May 2010 06:14:28 +0000 (+0200) Subject: fixed Twig_Node_Module::__toString() to include information about blocks and macros X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=b030645847bb7e45ad19775186ef32a1430f11bc;p=web%2Fkonrad%2Ftwig.git fixed Twig_Node_Module::__toString() to include information about blocks and macros --- 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);