interface AssetOptimizerInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/Asset/AssetOptimizerInterface.php \Drupal\Core\Asset\AssetOptimizerInterface
  2. 8.9.x core/lib/Drupal/Core/Asset/AssetOptimizerInterface.php \Drupal\Core\Asset\AssetOptimizerInterface
  3. 11.x core/lib/Drupal/Core/Asset/AssetOptimizerInterface.php \Drupal\Core\Asset\AssetOptimizerInterface

Interface defining a service that optimizes an asset.

Hierarchy

Expanded class hierarchy of AssetOptimizerInterface

All classes that implement AssetOptimizerInterface

2 files declare their use of AssetOptimizerInterface
CssCollectionOptimizerLazyUnitTest.php in core/tests/Drupal/Tests/Core/Asset/CssCollectionOptimizerLazyUnitTest.php
CssCollectionOptimizerUnitTest.php in core/tests/Drupal/Tests/Core/Asset/CssCollectionOptimizerUnitTest.php

File

core/lib/Drupal/Core/Asset/AssetOptimizerInterface.php, line 8

Namespace

Drupal\Core\Asset
View source
interface AssetOptimizerInterface {
    
    /**
     * Optimizes an asset.
     *
     * @param array $asset
     *   An asset.
     *
     * @return string
     *   The optimized asset's contents.
     */
    public function optimize(array $asset);
    
    /**
     * Removes unwanted content from an asset.
     *
     * @param string $content
     *   The content of an asset.
     *
     * @return string
     *   The cleaned asset's contents.
     */
    public function clean($content);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
AssetOptimizerInterface::clean public function Removes unwanted content from an asset. 2
AssetOptimizerInterface::optimize public function Optimizes an asset. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.