mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
simplified the code a bit
This commit is contained in:
+3
-23
@@ -17,7 +17,7 @@
|
||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
* @version SVN: $Id$
|
||||
*/
|
||||
class Twig_Node implements Twig_NodeInterface, ArrayAccess, Countable, Iterator
|
||||
class Twig_Node implements Twig_NodeInterface, ArrayAccess, Countable, IteratorAggregate
|
||||
{
|
||||
protected $nodes;
|
||||
protected $attributes;
|
||||
@@ -224,28 +224,8 @@ class Twig_Node implements Twig_NodeInterface, ArrayAccess, Countable, Iterator
|
||||
return count($this->nodes);
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
public function getIterator()
|
||||
{
|
||||
reset($this->nodes);
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
return current($this->nodes);
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return key($this->nodes);
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
return next($this->nodes);
|
||||
}
|
||||
|
||||
public function valid()
|
||||
{
|
||||
return false !== current($this->nodes);
|
||||
return new ArrayIterator($this->nodes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user