本文整理汇总了PHP中Iterator::next方法的典型用法代码示例。如果您正苦于以下问题:PHP Iterator::next方法的具体用法?PHP Iterator::next怎么用?PHP Iterator::next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Iterator
的用法示例。
在下文中一共展示了Iterator::next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lazyAppend
/**
* Lazily append the next iterator to the chain
*/
private function lazyAppend()
{
if (!parent::valid() and $this->iterators->valid()) {
$this->append($this->iterators->current());
$this->iterators->next();
}
}
示例2: next
public function next()
{
$this->it->next();
if ($this->currentLen !== 0) {
--$this->currentLen;
}
}
示例3: subscribe
/**
* @param ObserverInterface $observer
* @param SchedulerInterface|null $scheduler
* @return \Rx\Disposable\CompositeDisposable|\Rx\DisposableInterface
*/
public function subscribe(ObserverInterface $observer, SchedulerInterface $scheduler = null)
{
$scheduler = $scheduler ?: new ImmediateScheduler();
$key = 0;
return $scheduler->scheduleRecursive(function ($reschedule) use(&$observer, &$key) {
try {
//HHVM requires you to call next() before current()
if (defined('HHVM_VERSION')) {
$this->items->next();
$key = $this->items->key();
}
if (null === $key) {
$observer->onCompleted();
return;
}
$current = $this->items->current();
$observer->onNext($current);
if (!defined('HHVM_VERSION')) {
$this->items->next();
$key = $this->items->key();
}
$reschedule();
} catch (\Exception $e) {
$observer->onError($e);
}
});
}
示例4: next
public function next()
{
if (!$this->usingCache) {
$this->innerIterator->next();
}
++$this->position;
}
示例5: next
public function next()
{
$this->i++;
if ($this->valid()) {
$this->it->next();
}
}
示例6: next
public function next()
{
$this->projectionNeeded = true;
unset($this->current);
unset($this->currentKey);
return $this->innerIterator->next();
}
示例7: next
public function next()
{
parent::next();
if (!parent::valid()) {
$this->source->next();
}
}
示例8: next
public function next()
{
while (true) {
$this->it->next();
if ($this->it->valid()) {
if ($this->fetch()) {
break;
}
} else {
if ($this->it === $this->it0) {
$this->it = $this->it1;
$this->it->rewind();
if ($this->it->valid()) {
if ($this->fetch()) {
break;
}
} else {
break;
}
} else {
break;
}
}
}
}
示例9: next
/**
* {@inheritdoc}
*/
public function next()
{
$this->neighbour->next();
if (!$this->neighbour->valid()) {
$this->neighbour->rewind();
parent::next();
}
}
示例10: next
public function next()
{
$this->currentIt->next();
if ($this->state === 1 && !$this->currentIt->valid()) {
$this->currentIt = $this->it2;
$this->state = 2;
}
}
示例11: next
public function next()
{
$this->i++;
if ($this->cacheSize == $this->i) {
$this->it->next();
$this->memo();
}
}
示例12: next
public function next()
{
$this->i++;
$this->it->next();
if ($this->it === $this->it0 && !$this->it->valid()) {
$this->it = $this->it1;
}
}
示例13: next
public function next()
{
$this->points->next();
if (!$this->points->valid()) {
$this->series->next();
$serie = $this->series->current();
$this->points = new \ArrayIterator($serie ? $serie['values'] : []);
}
}
示例14: next
/**
* {@inheritdoc}
*/
public function next()
{
$this->key++;
$this->getCurrentIterator()->next();
if (!$this->currentIterator->valid()) {
$this->mainIterator->next();
$this->currentIterator = $this->mainIterator->current();
}
}
示例15: next
public function next()
{
$this->i++;
$this->it->next();
$v = $this->it->valid();
if (!$v) {
$this->it->rewind();
}
}