You are here

public function InstallablePluginBase::defaultConfiguration in Markdown 8.2

Gets default configuration for this plugin.

Return value

array An associative array with the default configuration.

Overrides AnnotatedPluginBase::defaultConfiguration

2 calls to InstallablePluginBase::defaultConfiguration()
BaseExtensibleParser::defaultConfiguration in src/Plugin/Markdown/BaseExtensibleParser.php
Gets default configuration for this plugin.
InstallablePluginBase::setConfiguration in src/Plugin/Markdown/InstallablePluginBase.php
Sets the configuration for this plugin instance.
1 method overrides InstallablePluginBase::defaultConfiguration()
BaseExtensibleParser::defaultConfiguration in src/Plugin/Markdown/BaseExtensibleParser.php
Gets default configuration for this plugin.

File

src/Plugin/Markdown/InstallablePluginBase.php, line 76

Class

InstallablePluginBase
Base class for installable plugins.

Namespace

Drupal\markdown\Plugin\Markdown

Code

public function defaultConfiguration() {
  $configuration['id'] = $this
    ->getPluginId();
  $configuration['weight'] = $this->pluginDefinition->weight;
  if ($this instanceof EnabledPluginInterface) {
    $configuration['enabled'] = $this
      ->enabledByDefault();
  }
  if ($this instanceof SettingsInterface) {
    $pluginDefinition = $this
      ->getPluginDefinition();
    $settings = isset($pluginDefinition['settings']) ? $pluginDefinition['settings'] : [];
    $configuration['settings'] = NestedArray::mergeDeep($settings, static::defaultSettings($pluginDefinition));
  }
  return $configuration;
}