예제 #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
파일: iterators.php 프로젝트: Sywooch/dump
 function current()
 {
     return $this->transformItem(parent::current(), parent::key());
 }
예제 #7
0
 public function key()
 {
     return (string) parent::key();
 }
예제 #8
0
파일: Mapper.php 프로젝트: jurasm2/nette
 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
파일: bug42703.php 프로젝트: badlamer/hhvm
{
    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
파일: nette.min.php 프로젝트: rotten77/xcv
 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());
 }