You are here

public function ScannerPluginManager::processDefinition in Search and Replace Scanner 8

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 DefaultPluginManager::processDefinition

File

src/Plugin/ScannerPluginManager.php, line 49

Class

ScannerPluginManager
Provides a Scanner plugin manager.

Namespace

Drupal\scanner\Plugin

Code

public function processDefinition(&$definition, $plugin_id) {
  parent::processDefinition($definition, $plugin_id);
  foreach ([
    'id',
    'type',
  ] as $required_property) {
    if (empty($definition[$required_property])) {
      throw new InvalidPluginDefinitionException($plugin_id, sprintf('The scanner %s must define the %s property.', $plugin_id, $required_property));
    }
  }
}