Assetic\Asset\AssetCollectionInterface::replaceLeaf
Replaces an existing leaf with a new one.
Signature
public function replaceLeaf(AssetInterface
$needle,
[AssetInterface
$replacement = false,
[Boolean
$graceful = false]] )
Parameters
$needle
— Assetic\Asset\AssetInterface- The current asset to replace
$replacement
— Assetic\Asset\AssetInterface- The new asset
$graceful
— object- Whether the failure should return false or throw an exception
Returns
- Boolean
- Whether the asset has been found
Errors/Exceptions
-
InvalidArgumentException
- If the asset cannot be found