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();
} } } private function indexFile(string
$file): void
{ $baseName =
pathinfo($file, PATHINFO_FILENAME
);
$fileName =
pathinfo($file, PATHINFO_BASENAME
);
// check if the filename matches thumbnail syntax like "*_200x200" or "*_200x200@2x"