GetAssetsEvent
API reference › Foxy › Event › GetAssetsEvent
Allows listeners to contribute asset packages before dependency solving.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates the asset collection event. | GetAssetsEvent |
addAsset() | Add the asset package. | GetAssetsEvent |
getAssetDir() | Get the directory of mock assets. | AbstractSolveEvent |
getAssets() | Get the map of asset package name and the asset package path. | GetAssetsEvent |
getPackages() | Get the installed Composer packages. | AbstractSolveEvent |
hasAsset() | Check if the asset package is present. | GetAssetsEvent |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $assetDir, Composer\Package\PackageInterface[] $packages, mixed[] $assets = [])Creates the asset collection event.
Parameters
| Parameter | Type | Description |
|---|---|---|
$assetDir | string | The directory of mock assets. |
$packages | Composer\ | All installed Composer packages. |
$assets | mixed[] | The map of asset package name and the asset package path. |
addAsset()
Section titled “addAsset() ”public function addAsset(string $name, string $path): selfAdd the asset package.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | The asset package name. |
$path | string | An absolute package manifest path or a ready file: directory reference. |
Returns
self
getAssets()
Section titled “getAssets() ”public function getAssets(): arrayGet the map of asset package name and the asset package path.
Returns
array
hasAsset()
Section titled “hasAsset() ”public function hasAsset(string $name): boolCheck if the asset package is present.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | The asset package name |
Returns
bool