Removes a leaf.
AssetInterface $leaf The leaf to remove:
Boolean $graceful Whether the failure should return false or throw an exception:
Boolean Whether the asset has been found
\InvalidArgumentException If the asset cannot be found
Overrides AssetCollectionInterface::removeLeaf
public function removeLeaf(AssetInterface $needle, $graceful = false) {
  foreach ($this->assets as $i => $asset) {
    $clone = isset($this->clones[$asset]) ? $this->clones[$asset] : null;
    if (in_array($needle, array(
      $asset,
      $clone,
    ), true)) {
      unset($this->clones[$asset], $this->assets[$i]);
      return true;
    }
    if ($asset instanceof AssetCollectionInterface && $asset
      ->removeLeaf($needle, true)) {
      return true;
    }
  }
  if ($graceful) {
    return false;
  }
  throw new \InvalidArgumentException('Leaf not found.');
}