Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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);
 }
Esempio n. 4
0
 public function key()
 {
     return "pre:" . parent::key();
 }
 public function current()
 {
     $iterator = $this->getInnerIterator();
     $callback = $this->callback;
     return $callback(parent::current(), parent::key(), $iterator);
 }
Esempio n. 6
0
 function current()
 {
     return $this->transformItem(parent::current(), parent::key());
 }
Esempio n. 7
0
 public function key()
 {
     return (string) parent::key();
 }
Esempio n. 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());
 }
Esempio n. 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());
Esempio n. 11
0
 public function current()
 {
     return new TokenRow($this->tokenProcessor, parent::key());
 }
Esempio n. 12
0
 public function key()
 {
     echo $this->key . ') ' . __METHOD__ . PHP_EOL;
     return parent::key();
 }
Esempio n. 13
0
 public function current()
 {
     return parent::key();
 }
Esempio n. 14
0
__construct(\Traversable$iterator,$callback){parent::__construct($iterator);$this->callback=callback($callback);}function
current(){return$this->callback->invoke(parent::current(),parent::key());}}class
Esempio n. 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);
     }
 }
Esempio n. 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();
 }
Esempio n. 18
0
 /**
  * @return mixed
  */
 public function current()
 {
     $callback = $this->_callback;
     return $callback(parent::current(), parent::key());
 }