*/ public function find(string $glob, array $excludePatterns = []): Promise { return coroutine(function () use ($glob, $excludePatterns) { $uris = []; foreach (new GlobIterator($glob) as $path) { // Exclude any directories that also match the glob pattern // Also exclude any path that matches one of the exclude patterns if (!is_dir($path) && !matchGlobs($path, $excludePatterns)) { $uris[] = pathToUri($path); } yield timeout(); } return $uris; }); } }