You are here

public function CoreSet::process in Icon API 8

Processes a IconSet.

Return value

array An associative array representing an IconSet

Overrides IconSetBase::process

File

src/Plugin/Icon/CoreSet.php, line 26

Class

CoreSet
Drupal Core Icon Set.

Namespace

Drupal\icon\Plugin\Icon

Code

public function process() {
  $mask = '/.svg/';
  $svg_icons = file_scan_directory(DRUPAL_ROOT . '/core/misc/icons', $mask, [
    'recurse' => TRUE,
  ]);
  foreach ($svg_icons as $icon_id => $icon_config) {
    $icon = [
      'id' => $icon_config->name,
      'filename' => $icon_config->filename,
      'path' => $icon_config->uri,
    ];
    $this
      ->setIcon($icon, $icon_config->name);
  }
}