Carew\Processor::processFile PHP Method

processFile() public method

public processFile ( Symfony\Component\Finder\SplFileInfo $file, $folder = '', $type = Document::TYPE_UNKNOWN )
$file Symfony\Component\Finder\SplFileInfo
    public function processFile(SplFileInfo $file, $folder = '', $type = Document::TYPE_UNKNOWN)
    {
        $internalPath = trim($folder . '/' . $file->getRelativePathname(), '/');
        $document = new Document($file, $internalPath, $type);
        $event = new CarewEvent($document);
        try {
            return $this->eventDispatcher->dispatch(Events::DOCUMENT_HEADER, $event)->getSubject();
        } catch (\Exception $e) {
            throw new \LogicException(sprintf('Could not process "%s": "%s".', $file->getRelativePathname(), $e->getMessage()), 0, $e);
        }
    }