function LibraryDiscoveryCollector::getLibraryByName

Overrides LibraryDiscoveryInterface::getLibraryByName

File

core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php, line 172

Class

LibraryDiscoveryCollector
A CacheCollector implementation for building library extension info.

Namespace

Drupal\Core\Asset

Code

public function getLibraryByName($extension, $name) {
    $libraries = $this->getLibrariesByExtension($extension);
    if (!isset($libraries[$name])) {
        return FALSE;
    }
    if (isset($libraries[$name]['deprecated'])) {
        // phpcs:ignore Drupal.Semantics.FunctionTriggerError
        @trigger_error(str_replace('%library_id%', "{$extension}/{$name}", $libraries[$name]['deprecated']), E_USER_DEPRECATED);
    }
    return $libraries[$name];
}

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