public function findFiles(string $pattern, int $flags = 0): FileCollection
    {
        $files = glob($this->path.'/'.$pattern, $flags);
        foreach ($files as $index => $file) {
            if (is_file($file)) {
                $files[$index] = new File($file);
            } else {
                unset($files[$index]);
            }
        }

        return new FileCollection($files);
    }