function LibraryDependencyResolverInterface::getMinimalRepresentativeSubset

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Asset/LibraryDependencyResolverInterface.php \Drupal\Core\Asset\LibraryDependencyResolverInterface::getMinimalRepresentativeSubset()
  2. 10 core/lib/Drupal/Core/Asset/LibraryDependencyResolverInterface.php \Drupal\Core\Asset\LibraryDependencyResolverInterface::getMinimalRepresentativeSubset()
  3. 11.x core/lib/Drupal/Core/Asset/LibraryDependencyResolverInterface.php \Drupal\Core\Asset\LibraryDependencyResolverInterface::getMinimalRepresentativeSubset()

Gets the minimal representative subset of the given libraries.

A minimal representative subset means that any library in the given set of libraries that is a dependency of another library in the set, is removed.

Hence a minimal representative subset is the most compact representation possible of a set of libraries.

(Each asset library has dependencies and can therefore be seen as a tree. Hence the given list of libraries represent a forest. This function returns all roots of trees that are not a subtree of another tree in the forest.)

Parameters

string[] $libraries: A set of libraries.

Return value

string[] A representative subset of the given set of libraries.

1 method overrides LibraryDependencyResolverInterface::getMinimalRepresentativeSubset()
LibraryDependencyResolver::getMinimalRepresentativeSubset in core/lib/Drupal/Core/Asset/LibraryDependencyResolver.php
Gets the minimal representative subset of the given libraries.

File

core/lib/Drupal/Core/Asset/LibraryDependencyResolverInterface.php, line 44

Class

LibraryDependencyResolverInterface
Resolves the dependencies of asset (CSS/JavaScript) libraries.

Namespace

Drupal\Core\Asset

Code

public function getMinimalRepresentativeSubset(array $libraries);

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