Beispiel #1
0
 /**
  * Returns the key of the current value
  *
  * @return Mixed
  */
 public function key()
 {
     $this->dumpStart(__FUNCTION__);
     $result = parent::key();
     $this->dumpEnd(__FUNCTION__, $result);
     return $result;
 }
Beispiel #2
0
 /**
  * returns the current key
  *
  * @return  mixed
  */
 public function key()
 {
     $key = parent::key();
     if (null !== $this->keyConsumer) {
         $consumeKey = $this->keyConsumer;
         $consumeKey($key);
     }
     return $key;
 }
Beispiel #3
0
 public function current()
 {
     if (!$this->valid()) {
         return NULL;
     }
     $this->_args[0] = parent::current();
     $this->_args[1] = parent::key();
     return call_user_func_array($this->_callback, $this->_args);
 }
 public function key()
 {
     return "pre:" . parent::key();
 }
 public function current()
 {
     $iterator = $this->getInnerIterator();
     $callback = $this->callback;
     return $callback(parent::current(), parent::key(), $iterator);
 }
Beispiel #6
0
 function current()
 {
     return $this->transformItem(parent::current(), parent::key());
 }
Beispiel #7
0
 public function key()
 {
     return (string) parent::key();
 }
Beispiel #8
0
 public function current()
 {
     return call_user_func($this->callback, parent::current(), parent::key());
 }
 /**
  * returns the current key
  *
  * @return  mixed
  */
 public function key()
 {
     if (!$this->valid()) {
         return null;
     }
     if (null === $this->keyMapper) {
         return parent::key();
     }
     $map = $this->keyMapper;
     return $map(parent::key(), parent::current());
 }
Beispiel #10
0
{
    public function rewind()
    {
    }
    public function next()
    {
    }
    public function valid()
    {
        return true;
    }
    public function current()
    {
        throw new Exception('boo');
    }
    public function key()
    {
    }
}
$it = new BlaIterator();
$itit = new IteratorIterator($it);
try {
    foreach ($itit as $key => $value) {
        echo $key, $value;
    }
} catch (Exception $e) {
    var_dump($e->getMessage());
}
var_dump($itit->current());
var_dump($itit->key());
 public function current()
 {
     return new TokenRow($this->tokenProcessor, parent::key());
 }
Beispiel #12
0
 public function key()
 {
     echo $this->key . ') ' . __METHOD__ . PHP_EOL;
     return parent::key();
 }
 public function current()
 {
     return parent::key();
 }
Beispiel #14
0
__construct(\Traversable$iterator,$callback){parent::__construct($iterator);$this->callback=callback($callback);}function
current(){return$this->callback->invoke(parent::current(),parent::key());}}class
Beispiel #15
0
 /**
  * Advances iterator, saving elements into the window
  * Keeps keys from iterable and removes first item if window grows too large
  */
 protected function advanceWindow()
 {
     $this->window[parent::key()] = parent::current();
     if (count($this->window) > $this->windowSize) {
         array_shift($this->window);
     }
 }
Beispiel #16
0
 function current()
 {
     return $this->callback->invoke(parent::current(), parent::key());
 }
 /**
  * Gets the current key (as required by the Iterator interface).
  *
  * @return string Iterator key
  */
 public function key()
 {
     return $this->iterator->key();
 }
Beispiel #18
0
 /**
  * @return mixed
  */
 public function current()
 {
     $callback = $this->_callback;
     return $callback(parent::current(), parent::key());
 }