AssetOptimizerInterface.php

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

Namespace

Drupal\Core\Asset

File

core/lib/Drupal/Core/Asset/AssetOptimizerInterface.php

View source
<?php

namespace Drupal\Core\Asset;


/**
 * Interface defining a service that optimizes an asset.
 */
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);

}

Interfaces

Title Deprecated Summary
AssetOptimizerInterface Interface defining a service that optimizes an asset.

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