listContents($path) as $item) { /** @var StorageAttributes $item */ if ($item->isFile() && str_ends_with($item->path(), '.py')) { return new MatchResult($path); } } return new EmptyMatchResult(); } }