Permalink
Browse files

Switch from IteratorAggregate to just Iterator and implement the meth…

…ods. This ensures that vars will be filtered correctly.
  • Loading branch information...
1 parent 1d44a1d commit 79713c23f18bc04fc2658a47cf73aafaf0161660 @saltybeagle saltybeagle committed Apr 9, 2010
Showing with 20 additions and 4 deletions.
  1. +20 −4 src/Templates/Savant/ObjectProxy/Traversable.php
@@ -1,15 +1,31 @@
<?php
namespace pear2\Templates\Savant\ObjectProxy;
use pear2\Templates\Savant\ObjectProxy;
-class Traversable extends ObjectProxy implements \IteratorAggregate
+class Traversable extends ObjectProxy implements \Iterator
{
- function getIterator()
+
+ function next()
+ {
+ $this->object->next();
+ }
+
+ function key()
+ {
+ return $this->object->key();
+ }
+
+ function valid()
+ {
+ return $this->object->valid();
+ }
+
+ function rewind()
{
- return $this->object;
+ $this->object->rewind();
}
function current()
{
- return self::filterVar(parent::current());
+ return $this->filterVar($this->object->current());
}
}

0 comments on commit 79713c2

Please sign in to comment.