mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
fixed Twig_Node_Set
git-svn-id: http://svn.twig-project.org/trunk@219 93ef8e89-cb99-4229-a87c-7fa0fa45744b
This commit is contained in:
+18
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class Twig_Node_Set extends Twig_Node
|
||||
class Twig_Node_Set extends Twig_Node implements Twig_NodeListInterface
|
||||
{
|
||||
protected $names;
|
||||
protected $values;
|
||||
@@ -30,6 +30,23 @@ class Twig_Node_Set extends Twig_Node
|
||||
return implode("\n", $repr);
|
||||
}
|
||||
|
||||
public function getNodes()
|
||||
{
|
||||
if ($this->isMultitarget)
|
||||
{
|
||||
return $this->values;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array($this->values);
|
||||
}
|
||||
}
|
||||
|
||||
public function setNodes(array $nodes)
|
||||
{
|
||||
$this->values = $this->isMultitarget ? $nodes : $nodes[0];
|
||||
}
|
||||
|
||||
public function compile($compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
Reference in New Issue
Block a user