public function AssetCollectionInterface::replaceLeaf

Replaces an existing leaf with a new one.

Parameters

AssetInterface $needle The current asset to replace:

AssetInterface $replacement The new asset:

Boolean $graceful Whether the failure should return false or throw an exception:

Return value

Boolean Whether the asset has been found

Throws

\InvalidArgumentException If the asset cannot be found

1 method overrides AssetCollectionInterface::replaceLeaf()
AssetCollection::replaceLeaf in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php
Replaces an existing leaf with a new one.

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php, line 58

Class

AssetCollectionInterface
An asset collection.

Namespace

Assetic\Asset

Code

public function replaceLeaf(AssetInterface $needle, AssetInterface $replacement, $graceful = false);