protected function createPageFile(DirectoryPath $repositoryPath, DirectoryPath $directoryPath, SplFileInfo $file) { $pageFile = new PageFile($repositoryPath->toAbsoluteFileString(), $directoryPath->toRelativeFileString(), $file->getRelativePathName()); $title = $this->elasticsearchRepository->getTitle($pageFile->getAbsolutePath()); if (empty($title)) { $title = $pageFile->getRelativePath()->getFileName(); } $pageFile->setTitle($title); return $pageFile; }
/** * @param DirectoryPath $repositoryPath * @param DirectoryPath $directoryPath * @param SplFileInfo $file * * @return PageFile */ protected function createPageFile(DirectoryPath $repositoryPath, DirectoryPath $directoryPath, SplFileInfo $file) { $pageFile = new PageFile($repositoryPath->toAbsoluteFileString(), $directoryPath->toRelativeFileString(), $file->getRelativePathName()); $pageFile->setTitle($pageFile->getRelativePath()->getFileName()); return $pageFile; }