interface AssetCollectionOptimizerInterface

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

Interface defining a service that optimizes a collection of assets.

Hierarchy

Expanded class hierarchy of AssetCollectionOptimizerInterface

All classes that implement AssetCollectionOptimizerInterface

3 files declare their use of AssetCollectionOptimizerInterface
AssetControllerBase.php in core/modules/system/src/Controller/AssetControllerBase.php
PerformanceForm.php in core/modules/system/src/Form/PerformanceForm.php
ThemeInstaller.php in core/lib/Drupal/Core/Extension/ThemeInstaller.php

File

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

Namespace

Drupal\Core\Asset
View source
interface AssetCollectionOptimizerInterface {
    
    /**
     * Optimizes a collection of assets.
     *
     * @param array $assets
     *   An asset collection.
     * @param array $libraries
     *   An array of library names.
     *
     * @return array
     *   An optimized asset collection.
     */
    public function optimize(array $assets, array $libraries);
    
    /**
     * Returns all optimized asset collections assets.
     *
     * @return string[]
     *   URIs for all optimized asset collection assets.
     *
     * @deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is
     *   no replacement.
     *
     * @see https://www.drupal.org/node/3301744
     */
    public function getAll();
    
    /**
     * Deletes all optimized asset collections assets.
     */
    public function deleteAll();

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Overrides
AssetCollectionOptimizerInterface::deleteAll public function Deletes all optimized asset collections assets. 4
AssetCollectionOptimizerInterface::getAll Deprecated public function Returns all optimized asset collections assets. 4
AssetCollectionOptimizerInterface::optimize public function Optimizes a collection of assets. 4

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