Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch from IteratorAggregate to just Iterator and implement the meth…

…ods. This ensures that vars will be filtered correctly.
  • Loading branch information...
commit 79713c23f18bc04fc2658a47cf73aafaf0161660 1 parent 1d44a1d
@saltybeagle saltybeagle authored
Showing with 20 additions and 4 deletions.
  1. +20 −4 src/Templates/Savant/ObjectProxy/Traversable.php
View
24 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());
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.