/** * Returns the key of the current value * * @return Mixed */ public function key() { $this->dumpStart(__FUNCTION__); $result = parent::key(); $this->dumpEnd(__FUNCTION__, $result); return $result; }
/** * returns the current key * * @return mixed */ public function key() { $key = parent::key(); if (null !== $this->keyConsumer) { $consumeKey = $this->keyConsumer; $consumeKey($key); } return $key; }
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); }
function current() { return $this->transformItem(parent::current(), parent::key()); }
public function key() { return (string) parent::key(); }
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()); }
{ 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()); }
public function key() { echo $this->key . ') ' . __METHOD__ . PHP_EOL; return parent::key(); }
public function current() { return parent::key(); }
__construct(\Traversable$iterator,$callback){parent::__construct($iterator);$this->callback=callback($callback);}function current(){return$this->callback->invoke(parent::current(),parent::key());}}class
/** * 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); } }
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(); }
/** * @return mixed */ public function current() { $callback = $this->_callback; return $callback(parent::current(), parent::key()); }