ResolvedPackage
API reference › Foxy › Native › ResolvedPackage
Represents a package chosen for installation: a registry tarball or a local file: directory.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$integrity readonly constructor | string| | Subresource Integrity value of a registry package. Default: null. | ResolvedPackage |
$name readonly constructor | string | Package name. | ResolvedPackage |
$path readonly constructor | string| | Local package directory: the manifest’s file: value without the prefix, as written. Default: null. | ResolvedPackage |
$resolved readonly constructor | string| | Tarball URL of a registry package. Default: null. | ResolvedPackage |
$version readonly constructor | string | Installed version. | ResolvedPackage |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Describes a registry or local package selected for installation. | ResolvedPackage |
fromLocal() static | Creates a local package from a file: dependency. | ResolvedPackage |
fromRegistry() static | Creates a registry package from the selected version’s tarball URL and integrity value. | ResolvedPackage |
isLocal() | Returns whether the package is copied from a local directory instead of downloaded from the registry. | ResolvedPackage |
toLock() | Returns the package entry written to foxy.lock. | ResolvedPackage |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $name, string $version, string|null $resolved = null, string|null $integrity = null, string|null $path = null)Describes a registry or local package selected for installation.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | Package name. |
$version | string | Installed version. |
$resolved | string| | Tarball URL of a registry package. |
$integrity | string| | Subresource Integrity value of a registry package. |
$path | string| | Local package directory: the manifest’s file: value without the prefix, as written. |
fromLocal()
Section titled “fromLocal() ”public static function fromLocal(string $name, string $version, string $path): selfCreates a local package from a file: dependency.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$version | string | |
$path | string |
Returns
self
fromRegistry()
Section titled “fromRegistry() ”public static function fromRegistry(Foxy\Native\PackageVersion $version): selfCreates a registry package from the selected version’s tarball URL and integrity value.
isLocal()
Section titled “isLocal() ”public function isLocal(): boolReturns whether the package is copied from a local directory instead of downloaded from the registry.
Returns
bool
toLock()
Section titled “toLock() ”public function toLock(): array{version: string, file: string}|array{version: string, resolved: string, integrity: string}Returns the package entry written to foxy.lock.
Returns
array{version: string, file: string}|array{version: string, resolved: string, integrity: string}