function IconPackManager::getExtractorFormDefaults

Overrides IconPackManagerInterface::getExtractorFormDefaults

File

core/lib/Drupal/Core/Theme/Icon/Plugin/IconPackManager.php, line 267

Class

IconPackManager
Defines an icon pack plugin manager to deal with icons.

Namespace

Drupal\Core\Theme\Icon\Plugin

Code

public function getExtractorFormDefaults(string $pack_id) : array {
    $icon_pack_definitions = $this->getDefinitions();
    if (!isset($icon_pack_definitions[$pack_id]) || !isset($icon_pack_definitions[$pack_id]['settings'])) {
        return [];
    }
    $default = [];
    foreach ($icon_pack_definitions[$pack_id]['settings'] as $name => $definition) {
        if (isset($definition['default'])) {
            $default[$name] = $definition['default'];
        }
    }
    return $default;
}

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