Constructs an InstalledPackage object.
string $name: The package name.
string $version: The package version.
string|null $path: The package path, or NULL if the package type is `metapackage`.
string $type: The package type.
private function __construct(string $name, string $version, ?string $path, string $type) { }