# LocalPackage

> Represents a local file: package of the root manifest as the resolver selects it: a fixed version and the requirements its own manifest declares.

[API reference](/docs/api/index.md) › [Foxy](/docs/extensions/foxy/reference/index.md) › [Native](/docs/extensions/foxy/reference/native/index.md) › LocalPackage

| final readonly class | `Foxy\Native\LocalPackage` |
| --- | --- |
| Source | [`src/Native/LocalPackage.php`](https://github.com/php-forge/foxy/blob/main/src/Native/LocalPackage.php#L11) |

Represents a local `file:` package of the root manifest as the resolver selects it: a fixed version and the
requirements its own manifest declares.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-name"></span>`$name` readonly constructor | `string` | Package name, the source of its requirements. | `LocalPackage` |
| <span id="property-path"></span>`$path` readonly constructor | `string` | Local package directory: the manifest's `file:` value without the prefix, as written. | `LocalPackage` |
| <span id="property-requirements"></span>`$requirements` readonly constructor | `list<`[`Requirement`](/docs/extensions/foxy/reference/native/requirement/index.md)`>` | Dependencies, non-optional peers, and optional dependencies it declares. | `LocalPackage` |
| <span id="property-version"></span>`$version` readonly constructor | `string` | Version declared by its `package.json` (`0.0.0` when absent). | `LocalPackage` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Describes a local package selected by the native resolver. | `LocalPackage` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(string $name, string $version, string $path, list<Foxy\Native\Requirement> $requirements)
```

Describes a local package selected by the native resolver.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` | Package name, the source of its requirements. |
| `$version` | `string` | Version declared by its `package.json` (`0.0.0` when absent). |
| `$path` | `string` | Local package directory: the manifest's `file:` value without the prefix, as written. |
| `$requirements` | `list<`[`Requirement`](/docs/extensions/foxy/reference/native/requirement/index.md)`>` | Dependencies, non-optional peers, and optional dependencies it declares. |