You are here

public function ExtensionManager::processDefinition in Markdown 8.2

Performs extra processing on plugin definitions.

By default we add defaults for the type to the definition. If a type has additional processing logic they can do that by replacing or extending the method.

Overrides InstallablePluginManager::processDefinition

File

src/PluginManager/ExtensionManager.php, line 136

Class

ExtensionManager
Markdown Extension Plugin Manager.

Namespace

Drupal\markdown\PluginManager

Code

public function processDefinition(&$definition, $pluginId) {
  if (!$definition instanceof MarkdownExtension) {
    return;
  }
  if ($requires = $definition->requires) {
    foreach ($requires as $key => $extensionId) {
      $requirement = new InstallableRequirement();
      $requirement->id = "extension:{$extensionId}";
      $definition->runtimeRequirements[] = $requirement;
    }
    unset($definition->requires);
  }
  parent::processDefinition($definition, $pluginId);
}