/** * 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(); } }
/** * 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(); } }
/** * Get current key * * @return mixed */ public function key() { return $this->generator ? $this->generator->key() : $this->index++; }