src/Viserio/Component/Filesystem/Filesystem.php
public function files(string $directory): array
    {
        $files = \array_diff(\scandir($directory, \SCANDIR_SORT_ASCENDING), ['..', '.']);

        // To get the appropriate files, we'll simply scan the directory and filter
        // out any "files" that are not truly files so we do not end up with any
        // directories in our list, but only true files within the directory.
        return \array_filter($files, static function ($file) use ($directory) {
            return \filetype($directory . \DIRECTORY_SEPARATOR . $file) === 'file';
        });
    }
public function files(string $directory): array
    {
        $files = \array_diff(\scandir($directory, \SCANDIR_SORT_ASCENDING), ['..', '.']);

        // To get the appropriate files, we'll simply scan the directory and filter
        // out any "files" that are not truly files so we do not end up with any
        // directories in our list, but only true files within the directory.
        return \array_filter($files, static function ($file) use ($directory) {
            return \filetype($directory . \DIRECTORY_SEPARATOR . $file) === 'file';
        });
    }
{@inheritdoc}