You are here

public function TfaValidationPluginManager::getDefinition in Two-factor Authentication (TFA) 8

Provide some backwards compatibility with the old implicit setupPluginId. This will give other modules more time to update their plugins.

Overrides DiscoveryCachedTrait::getDefinition

Deprecated

in tfa:8.x-1.0-alpha7 and is removed from tfa:8.x-2.0. Please specify the setupPluginId property in the plugin annotation.

See also

https://www.drupal.org/project/tfa/issues/2925066

1 call to TfaValidationPluginManager::getDefinition()
TfaValidationPluginManager::createInstance in src/TfaValidationPluginManager.php
Create an instance of a validation plugin.

File

src/TfaValidationPluginManager.php, line 129

Class

TfaValidationPluginManager
The validation plugin manager.

Namespace

Drupal\tfa

Code

public function getDefinition($plugin_id, $exception_on_invalid = TRUE) {
  $plugin = parent::getDefinition($plugin_id, $exception_on_invalid);
  if (is_array($plugin) && empty($plugin['setupPluginId'])) {
    $plugin['setupPluginId'] = $plugin_id . '_setup';
  }
  return $plugin;
}