예제 #1
0
 /**
  * Returns the unique key of the current leaf.
  *
  * @return null|int|string Returns the unique key of the current leaf on
  *                         success, null otherwise
  */
 public function key()
 {
     if (is_null($this->current)) {
         $this->current = current($this->branch);
     }
     if ($this->current instanceof RecursiveLeafInterface) {
         return $this->current->key();
     }
 }
예제 #2
0
 /**
  * Returns the unique key of the current leaf.
  *
  * @return null|int|string Returns the unique key of the current leaf on
  *                         success, null otherwise
  */
 public function key()
 {
     if (is_null($this->current)) {
         return $this->getUniqueKey();
     }
     if ($this->current instanceof RecursiveLeafInterface) {
         return $this->current->key();
     }
 }
예제 #3
0
 /**
  * Get current key
  *
  * @return mixed
  */
 public function key()
 {
     return $this->generator ? $this->generator->key() : $this->index++;
 }