Yosymfony\Spress\Core\DataSource\Filesystem\FilesystemDataSource::processItems PHP Method

processItems() private method

private processItems ( Finder $finder, $type )
$finder Symfony\Component\Finder\Finder
    private function processItems(Finder $finder, $type)
    {
        foreach ($finder as $file) {
            $id = $this->normalizeDirSeparator($file->getRelativePathname());
            $isBinary = $this->isBinary($file);
            $contentRaw = $isBinary ? '' : $file->getContents();
            $item = new Item($contentRaw, $id, [], $isBinary, $type);
            $item->setPath($this->normalizeDirSeparator($file->getRelativePathname()), Item::SNAPSHOT_PATH_RELATIVE);
            if ($isBinary === true) {
                $item->setPath($this->normalizeDirSeparator($file->getRealPath()), Item::SNAPSHOT_PATH_SOURCE);
            }
            switch ($type) {
                case Item::TYPE_LAYOUT:
                    $this->processAttributes($item, $file);
                    $this->layouts[$id] = $item;
                    break;
                case Item::TYPE_INCLUDE:
                    $this->includes[$id] = $item;
                    break;
                default:
                    $this->processAttributes($item, $file);
                    $this->items[$id] = $item;
                    break;
            }
        }
    }