function TestExtractorWithFinder::discoverIcons

Get a list of all the icons discovered by this extractor.

The icons must be provided as an associative array keyed by the icon id with values used to load the icon: source and group.

Return value

array List of icons that are found by this extractor. Keyed by icon full id.

Overrides IconExtractorInterface::discoverIcons

File

core/modules/system/tests/modules/icon_test/src/Plugin/IconExtractor/TestExtractorWithFinder.php, line 28

Class

TestExtractorWithFinder
Test plugin implementation of the icon_extractor.

Namespace

Drupal\icon_test\Plugin\IconExtractor

Code

public function discoverIcons() : array {
  $files = $this->getFilesFromSources();
  $icons = [];
  foreach ($files as $file) {
    if (!isset($file['icon_id'])) {
      continue;
    }
    $icons[] = $this->createIcon($file['icon_id'], $file['source'], $file['group'] ?? NULL);
  }
  return $icons;
}

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