function IconExtractorWithFinder::checkRequiredConfigSources

Check the required `config > sources` value from definition.

Throws

\Drupal\Core\Theme\Icon\Exception\IconPackConfigErrorException If the config:sources value in definition is not set or not valid.

2 calls to IconExtractorWithFinder::checkRequiredConfigSources()
IconExtractorWithFinder::getFilesFromSources in core/lib/Drupal/Core/Theme/Icon/IconExtractorWithFinder.php
Create files data from sources config.
SvgExtractor::discoverIcons in core/lib/Drupal/Core/Theme/Plugin/IconExtractor/SvgExtractor.php
Get a list of all the icons discovered by this extractor.

File

core/lib/Drupal/Core/Theme/Icon/IconExtractorWithFinder.php, line 81

Class

IconExtractorWithFinder
Base class for icon_extractor plugins.

Namespace

Drupal\Core\Theme\Icon

Code

protected function checkRequiredConfigSources() : void {
    if (!isset($this->configuration['config']['sources']) || empty($this->configuration['config']['sources']) || !is_array($this->configuration['config']['sources'])) {
        throw new IconPackConfigErrorException(sprintf('Missing or invalid `config: sources` in your definition, extractor %s requires this value as array.', $this->getPluginId()));
    }
}

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