processFilesIn example

$deletedThumbnails = $this->deleteThumbnails($io$filesystem$thumbnailFiles);

        $io->success(sprintf('Removed %d/%d orphaned thumbnails.', $deletedThumbnails, \count($thumbnailFiles)));
    }

    private function processFilesIn(string $directory, FilesystemInterface $filesystem, ProgressBar $progressBar): void
    {
        $contents = $filesystem->listContents($directory);

        foreach ($contents as $item) {
            if ($item['type'] === 'dir') {
                $this->processFilesIn($item['path']$filesystem$progressBar);
            }

            if ($item['type'] === 'file') {
                if (str_starts_with($item['basename'], '.')) {
                    continue;
                }

                $this->indexFile($item['path']);
                $progressBar->advance();
            }
        }
    }
Home | Imprint | This part of the site doesn't use cookies.