Remove transforms for a given asset

@param Asset $asset
335581
public function removeTransformsForAsset(Asset $asset)
    {
        $config = self::getConfig();

        try {
            $sourceModel = new LocalSourceImageModel($asset);
            $targetModel = new LocalTargetImageModel($sourceModel, []);

            if (strpos($targetModel->path, $config->imagerSystemPath) !== false) {
                try {
                    FileHelper::clearDirectory(FileHelper::normalizePath($targetModel->path));
                } catch (ErrorException $e) {
                    Craft::error('Could not clear directory "'.$targetModel->path.'" ('.$e->getMessage().')', __METHOD__);
                } catch (InvalidParamException $e) {
                    Craft::error('Could not clear directory "'.$targetModel->path.'" ('.$e->getMessage().')', __METHOD__);
                }

                Craft::$app->templateCaches->deleteCachesByElementId($asset->id);

                if ($sourceModel->type !== 'local' && file_exists($sourceModel->getFilePath())) {
                    try {
                        FileHelper::unlink($sourceModel->getFilePath());
                    } catch (ErrorException $e) {
                        Craft::error('Could not remove file "'.$sourceModel->getFilePath().'" ('.$e->getMessage().')', __METHOD__);
                    }
                }
            }
        } catch (ImagerException $e) {
            Craft::error($e->getMessage(), __METHOD__);
        }
    }
1299836
protected function fixAssets(array $assets)
    {
        $ignore = array('jquery-last.min.js',
                        'jquery-ui.min.js',
                        'jquery.easing-1.3.js',
                        'jquery.metadata.js',
                        'jquery.ui.position.js',);
        foreach ($assets as $key => $asset) {
            if (in_array(basename($asset), $ignore)) {
                unset($assets[$key]);
            }
        }

        return $assets;
    }
260516
public function get (Asset $asset) : Asset
    {
        $cache = $this->locator->get(AssetsCache::class);
        $cachedAsset = $cache->get($asset);

        if (null !== $cachedAsset)
        {
            return $cachedAsset;
        }

        return $this->addAsset($asset);
    }
1344466
public function filterLoad(AssetInterface $asset)
    {
        $root = $asset->getSourceRoot();
        $path = $asset->getSourcePath();

        $compiler = new \SassParser($this->presets);

        if ($root and $path) {
            $compiler->load_paths = array_merge($compiler->load_paths, array($root.'/'.$path));
        }

        $compiler->load_paths = array_merge($compiler->load_paths, $this->importPaths);

        $asset->setContent($compiler->toCss($asset->getContent(), false));
    }
1330565
public function replaceAsset($replace, $with)
    {
        $old = $this->assets()->findOrFail($replace);

        $this->assets()->detach($old->id);
        $old->delete();

        $this->addFile(Asset::findOrFail($with), $old->pivot->type, $old->pivot->locale);
    }
846070
public function filterDump(AssetInterface $asset)
    {
        $this->assetDirectory = $this->realPath($asset->getSourceRoot());

        $content = $asset->getContent();

        // Spin through the symlinks and normalize them. We'll first unset the original
        // symlink so that it doesn't clash with the new symlinks once they are added
        // back in.
        foreach ($this->symlinks as $link => $target)
        {
            unset($this->symlinks[$link]);

            if ($link == '//')
            {
                $link = $this->documentRoot;
            }
            else
            {
                $link = str_replace('//', $this->documentRoot.'/', $link);
            }

            $link = strtr($link, '/', DIRECTORY_SEPARATOR);

            $this->symlinks[$link] = $this->realPath($target);
        }

        $content = $this->trimUrls($content);

        $content = preg_replace_callback('/@import\\s+([\'"])(.*?)[\'"]/', array($this, 'processUriCallback'), $content);

        $content = preg_replace_callback('/url\\(\\s*([^\\)\\s]+)\\s*\\)/', array($this, 'processUriCallback'), $content);

        $asset->setContent($content);
    }
976447
public function replaceWith($properties)
    {
        $removed = array_diff(array_keys($this->_values), array_keys($properties));
        foreach ($removed as $k) {
            unset($this->$k);
        }

        foreach ($properties as $k => $v) {
            $this->$k = $v;
        }
    }
918837
public function removeTransformation(TransformationInterface $transformation)
    {

        $this->transformations = array_filter($this->transformations, function (TransformationInterface $t) use ($transformation) {

            return $t !== $transformation;
        });

        return $this;
    }
240970
public function remove($alias)
    {
        unset(
            $this->_instances[$alias],
            $this->_options[$alias],
            $this->_config[$alias]
        );
    }
866541
public function set_assets( $assets ) {

		foreach ( $assets as $type => $asset ) {
			$this->enqueue( $asset, $type );
		}
	}
899597
public function removeAssets()
    {
        // Base implementation does only know about log file.
        if ($this->logFile) {
            if (file_exists($this->logFile)) {
                unlink($this->logFile);
            }
            $this->logFile = null;
            $this->file->remove('log');
        }
    }
1231140
private function filterAsset(array $filters, Asset $asset)
    {
        $asset->setOutputExtension(null);

        foreach ($filters as $filter) {
            if ($this->loadFilter($filter)) {
                try {
                    $this->filtersInstances[$filter]->filter($asset);
                    $this->filtersInstances[$filter]->setOutputExtension($asset);
                } catch (PhassetsInternalException $e) {
                    $this->loadedLogger->error('An error occurred while filtering the asset: ' . $e);
                }
            }
        }
    }
1077086
public function addPublicAsset($asset)
    {
        // Remove from protected / deleted lists
        $key = $this->getAssetKey($asset);
        unset($this->protected[$key]);
        unset($this->deleted[$key]);
        // Skip if already public
        if (isset($this->public[$key])) {
            return false;
        }
        unset($asset['Variant']);
        $this->public[$key] = $asset;
        return true;
    }
872590
private function applyFilterOutputExtension(array $filters, Asset $asset)
    {
        foreach ($filters as $filter) {
            if ($this->loadFilter($filter)) {
                try {
                    $this->filtersInstances[$filter]->setOutputExtension($asset);
                } catch (PhassetsInternalException $e) {
                    $this->loadedLogger->error('An error occurred while filtering the asset: ' . $e);
                }
            }
        }
    }
1257298
public function remove($index)
    {
        if( $index >= count($this->generators) || $index < 0 )
            return;
        
        unset($this->generators[$index]);
        $this->generators = array_values($this->generators);
    }
820440
public function registerRemovedAsset(AssetInterface $asset)
    {
        $assetIdentifier = $this->persistenceManager->getIdentifierByObject($asset);
        $importedAsset = $this->importedAssetRepository->findOneByLocalAssetIdentifier($assetIdentifier);
        if ($importedAsset !== null) {
            $this->importedAssetRepository->remove($importedAsset);
            $this->logger->debug(sprintf('Asset removed: %s / %s', $asset->getResource()->getFilename(), $this->persistenceManager->getIdentifierByObject($asset)));
        }
    }
674381
public function filterDump(AssetInterface $asset)
    {
        $commandline = $this->getBinary();
        $formats = array();
        $optimizations = array();

        if ($this->keepLineBreaks) {
            if ($this->isV4()) {
                $format[] = 'keep-breaks';
            } else {
                array_push($commandline, '--keep-line-breaks');
            }
        }

        if ($this->compatibility) {
            array_push($commandline, '--compatibility ' . $this->compatibility);
        }

        if ($this->debug) {
            array_push($commandline, '--debug');
        }

        if ($this->rootPath) {
            if ($this->isV4()) {
                $this->deprecatedOption('rootPath');
            } else {
                array_push($commandline, '--root ' . $this->rootPath);
            }
        }

        if ($this->skipImport) {
            if ($this->isV4()) {
                array_push($commandline, '--inline=none');
            } else {
                array_push($commandline, '--skip-import');
            }
        }

        if ($this->timeout) {
            if ($this->isV4()) {
                array_push($commandline, '--inline-timeout' . $this->timeout);
            } else {
                array_push($commandline, '--timeout ' . $this->timeout);
            }
        }

        if ($this->roundingPrecision) {
            if ($this->isV4()) {
                $this->deprecatedOption('roundingPrecision');
            } else {
                array_push($commandline, '--rounding-precision ' . $this->roundingPrecision);
            }
        }

        if ($this->removeSpecialComments) {
            if ($this->isV4()) {
                $optimizations[] = 'specialComments:0';
            } else {
                array_push($commandline, '--s0');
            }
        }

        if ($this->onlyKeepFirstSpecialComment) {
            if ($this->isV4()) {
                $optimizations[] = 'specialComments:1';
            } else {
                array_push($commandline, '--s1');
            }
        }

        if ($this->semanticMerging) {
            if ($this->isV4()) {
                $this->deprecatedOption('semanticMerging');
            } else {
                array_push($commandline, '--semantic-merging');
            }
        }

        if ($this->skipAdvanced) {
            $this->deprecatedOption('skipAdvanced');
            array_push($commandline, '--skip-advanced');
        }

        if ($this->skipAggresiveMerging) {
            if ($this->isV4()) {
                $this->deprecatedOption('skipAggresiveMerging');
            } else {
                array_push($commandline, '--skip-aggressive-merging');
            }
        }

        if ($this->skipImportFrom) {
            $this->deprecatedOption('skipImportFrom');
            array_push($commandline, '--skip-import-from ' . $this->skipImportFrom);
        }

        if ($this->mediaMerging) {
            if ($this->isV4()) {
                $this->deprecatedOption('mediaMerging');
            } else {
                array_push($commandline, '--skip-media-merging');
            }
        }

        if ($this->skipRebase) {
            $this->deprecatedOption('skipRebase');
            array_push($commandline, '--skip-rebase');
        }

        if ($this->skipRestructuring) {
            if ($this->isV4()) {
                $this->deprecatedOption('skipRestructuring');
            } else {
                array_push($commandline, '--skip-restructuring');
            }
        }

        if ($this->skipShorthandCompacting) {
            $this->deprecatedOption('skipShorthandCompacting');
            array_push($commandline, '--skip-shorthand-compacting');
        }

        if ($this->sourceMap) {
            array_push($commandline, '--source-map');
        }

        if ($this->sourceMapInlineSources) {
            array_push($commandline, '--source-map-inline-sources');
        }

        if (!empty($formats)) {
            array_push($commandline, '--format', implode(';', $formats));
        }

        if (!empty($optimizations)) {
            array_push($commandline, '-O1', implode(';', $optimizations));
        }

        // input and output files
        $input = tempnam(sys_get_temp_dir(), 'input');

        file_put_contents($input, $asset->getContent());
        array_push($commandline, $input);

        $proc = new Process(implode(' ', $commandline));
        $code = $proc->run();
        unlink($input);

        if (127 === $code) {
            throw new \RuntimeException('Path to node executable could not be resolved.');
        }

        if (0 !== $code) {
            throw FilterException::fromProcess($proc)->setInput($asset->getContent());
        }

        $asset->setContent($proc->getOutput());
    }