You are here

protected function ConfigFilterPluginManager::findDefinitions in Config Filter 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/ConfigFilterPluginManager.php \Drupal\config_filter\Plugin\ConfigFilterPluginManager::findDefinitions()

Finds plugin definitions.

Return value

array List of definitions to store in cache.

Overrides DefaultPluginManager::findDefinitions

File

src/Plugin/ConfigFilterPluginManager.php, line 63

Class

ConfigFilterPluginManager
Provides the Config filter plugin plugin manager.

Namespace

Drupal\config_filter\Plugin

Code

protected function findDefinitions() {
  $definitions = array_map(function ($definition) {
    if (empty($definition['storages'])) {

      // The sync storage is the default.
      $definition['storages'] = [
        'config.storage.sync',
      ];
    }
    return $definition;
  }, parent::findDefinitions());

  // Sort the definitions by weight.
  uasort($definitions, [
    'Drupal\\Component\\Utility\\SortArray',
    'sortByWeightElement',
  ]);
  return $definitions;
}