_splFileInfoClass = $splFileInfoClass; parent::__construct($path); $this->setRelativePath($path); return; } /** * Current. * Please, see \DirectoryIterator::current() method. * * @return mixed */ public function current() { $out = parent::current(); if (null !== $this->_splFileInfoClass && $out instanceof \SplFileInfo) { $out->setInfoClass($this->_splFileInfoClass); $out = $out->getFileInfo(); if ($out instanceof \Hoa\Iterator\SplFileInfo) { $out->setRelativePath($this->getRelativePath()); } } return $out; } /** * Set relative path. * * @param string $relativePath Relative path. * @return string */ protected function setRelativePath($path) { $old = $this->_relativePath; $this->_relativePath = $path; return $old; } /** * Get relative path (if given). * * @return string */ public function getRelativePath() { return $this->_relativePath; } }