public function InstallablePluginManager::all in Markdown 8.2
Retrieves all registered plugins.
Parameters
array $configuration: The configuration used to create plugin instances.
bool $includeFallback: Flag indicating whether to include the fallback plugin.
Return value
\Drupal\markdown\Plugin\Markdown\InstallablePluginInterface[] An array of installed plugins instances, keyed by plugin identifier.
Overrides InstallablePluginManagerInterface::all
File
- src/
PluginManager/ InstallablePluginManager.php, line 86
Class
- InstallablePluginManager
- Installable Plugin Manager.
Namespace
Drupal\markdown\PluginManagerCode
public function all(array $configuration = [], $includeFallback = FALSE) {
$definitions = $this
->getDefinitions($includeFallback);
uasort($definitions, function (InstallablePlugin $a, InstallablePlugin $b) {
if ($a->weight === $b->weight) {
return 0;
}
return $a->weight < $b->weight ? -1 : 1;
});
return array_map(function (InstallablePlugin $definition) use ($configuration) {
$id = $definition
->getId();
return $this
->createInstance($id, isset($configuration[$id]) ? $configuration[$id] : $configuration);
}, $definitions);
}