Пример #1
0
 /**
  * Move forward to next leaf.
  */
 public function next()
 {
     if ($this->current instanceof RecursiveLeafInterface) {
         $this->current->next();
         if ($this->current->valid()) {
             if (!isset($this->crown[$this->key()])) {
                 throw new UnexpectedValueException(sprintf('Unexpected element with a unique key "%s".', $this->key()));
             }
             return;
         }
     }
     $this->current = next($this->branch);
 }
Пример #2
0
 /**
  * Move forward to next leaf.
  */
 public function next()
 {
     if (is_null($this->current)) {
         $this->current = current($this->children);
         return;
     }
     if ($this->current instanceof RecursiveLeafInterface) {
         $this->current->next();
         if ($this->current->valid()) {
             return;
         }
     }
     $this->current = next($this->children);
 }
Пример #3
0
 /**
  * Get next item
  */
 public function next()
 {
     if ($this->generator) {
         $this->generator->next();
     }
 }