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