Service discovery by Graph API

Thanks to timplunkett these lines

$yaml_discovery = new \Drupal\Component\Discovery\YamlDiscovery('services', \Drupal::moduleHandler()->getModuleDirectories());
foreach ($yaml_discovery->findAll() as $module => $services) {
}
helps to render the Drupal\ckeditor\CKEditorPluginManager.

Note the image below has too many connections which is fixed now.

Right click the image and open in a new tab.


digraph G { graph [rankdir="BT"] "Drupal\\ckeditor\\CKEditorPluginManager" [shape="record" label="{Drupal\\ckeditor\\CKEditorPluginManager||+ __construct(namespaces : Traversable, cache_backend : Drupal\\Core\\Cache\\CacheBackendInterface, language_manager : Drupal\\Core\\Language\\LanguageManager, module_handler : Drupal\\Core\\Extension\\ModuleHandlerInterface)\l+ getEnabledPluginFiles(editor : Drupal\\editor\\Entity\\Editor, include_internal_plugins : bool = false) : array\l+ getButtons() : array\l+ injectPluginSettingsForm(inout form : array, inout form_state : array, editor : Drupal\\editor\\Entity\\Editor)\l}"] "Drupal\\Core\\Plugin\\DefaultPluginManager" [shape="record" label="{Drupal\\Core\\Plugin\\DefaultPluginManager|# definitions : array\l# cacheBackend : mixed\l# cacheKeyPrefix : string\l# cacheKey : string\l# cacheTags : array = []\l# alterHook : string\l# subdir : mixed\l# moduleHandler : mixed\l# languageManager : mixed\l|+ __construct(subdir : mixed, namespaces : Traversable, plugin_definition_annotation_name : string = \"Drupal\\Component\\Annotation\\Plugin\")\l+ setCacheBackend(cache_backend : Drupal\\Core\\Cache\\CacheBackendInterface, language_manager : Drupal\\Core\\Language\\LanguageManager, cache_key_prefix : string, cache_tags : array = [])\l# alterInfo(module_handler : Drupal\\Core\\Extension\\ModuleHandlerInterface, alter_hook : string)\l+ getDefinition(plugin_id)\l+ getDefinitions()\l+ clearCachedDefinitions()\l# getCachedDefinitions() : mixed\l# setCachedDefinitions(definitions : array)\l# findDefinitions() : array\l}"] "Drupal\\Component\\Plugin\\PluginManagerBase" [shape="record" label="{«abstract»\nDrupal\\Component\\Plugin\\PluginManagerBase|# discovery : mixed\l# factory : mixed\l# mapper : mixed\l# defaults : array = []\l|+ getDefinition(plugin_id)\l+ getDefinitions()\l+ clearCachedDefinitions()\l+ createInstance(plugin_id, configuration = [])\l+ getInstance(options)\l+ processDefinition(inout definition, plugin_id)\l}"] "Drupal\\Component\\Plugin\\PluginManagerInterface" [shape="record" label="{«interface»\nDrupal\\Component\\Plugin\\PluginManagerInterface||}"] "Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface" [shape="record" label="{«interface»\nDrupal\\Component\\Plugin\\Discovery\\DiscoveryInterface||+ getDefinition(plugin_id : string) : mixed\l+ getDefinitions() : array\l}"] "Drupal\\Component\\Plugin\\Factory\\FactoryInterface" [shape="record" label="{«interface»\nDrupal\\Component\\Plugin\\Factory\\FactoryInterface||+ createInstance(plugin_id : string, configuration : array) : object\l}"] "Drupal\\Component\\Plugin\\Mapper\\MapperInterface" [shape="record" label="{«interface»\nDrupal\\Component\\Plugin\\Mapper\\MapperInterface||+ getInstance(options : array) : mixed\l}"] "Drupal\\Component\\Plugin\\Discovery\\CachedDiscoveryInterface" [shape="record" label="{«interface»\nDrupal\\Component\\Plugin\\Discovery\\CachedDiscoveryInterface||+ clearCachedDefinitions()\l}"] "Drupal\\Component\\Plugin\\PluginManagerInterface" -> "Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\PluginManagerInterface" -> "Drupal\\Component\\Plugin\\Factory\\FactoryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\PluginManagerInterface" -> "Drupal\\Component\\Plugin\\Mapper\\MapperInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\PluginManagerBase" -> "Drupal\\Component\\Plugin\\PluginManagerInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\PluginManagerBase" -> "Drupal\\Component\\Plugin\\Mapper\\MapperInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\PluginManagerBase" -> "Drupal\\Component\\Plugin\\Factory\\FactoryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\PluginManagerBase" -> "Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\Discovery\\CachedDiscoveryInterface" -> "Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Component\\Plugin\\PluginManagerBase" -> "Drupal\\Component\\Plugin\\Discovery\\CachedDiscoveryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Core\\Plugin\\DefaultPluginManager" -> "Drupal\\Component\\Plugin\\PluginManagerBase" [arrowhead="empty"] "Drupal\\Core\\Plugin\\DefaultPluginManager" -> "Drupal\\Component\\Plugin\\Discovery\\CachedDiscoveryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Core\\Plugin\\DefaultPluginManager" -> "Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Core\\Plugin\\DefaultPluginManager" -> "Drupal\\Component\\Plugin\\Factory\\FactoryInterface" [arrowhead="empty" style="dashed"] "Drupal\\Core\\Plugin\\DefaultPluginManager" -> "Drupal\\Component\\Plugin\\Mapper\\MapperInterface" [arrowhead="empty" style="dashed"] "Drupal\\Core\\Plugin\\DefaultPluginManager" -> "Drupal\\Component\\Plugin\\PluginManagerInterface" [arrowhead="empty" style="dashed"] "Drupal\\ckeditor\\CKEditorPluginManager" -> "Drupal\\Core\\Plugin\\DefaultPluginManager" [arrowhead="empty"] "Drupal\\ckeditor\\CKEditorPluginManager" -> "Drupal\\Component\\Plugin\\PluginManagerInterface" [arrowhead="empty" style="dashed"] "Drupal\\ckeditor\\CKEditorPluginManager" -> "Drupal\\Component\\Plugin\\Mapper\\MapperInterface" [arrowhead="empty" style="dashed"] "Drupal\\ckeditor\\CKEditorPluginManager" -> "Drupal\\Component\\Plugin\\Factory\\FactoryInterface" [arrowhead="empty" style="dashed"] "Drupal\\ckeditor\\CKEditorPluginManager" -> "Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface" [arrowhead="empty" style="dashed"] "Drupal\\ckeditor\\CKEditorPluginManager" -> "Drupal\\Component\\Plugin\\Discovery\\CachedDiscoveryInterface" [arrowhead="empty" style="dashed"] }

To do this yourself install https://drupal.org/project/graphapi and enable graphapi_class aka 'Devel UML Diagrams' configure the ClassDiagram input filter