authman-1.x-dev/src/Plugin/AuthmanOauth/AuthmanOauthPluginBase.php
src/Plugin/AuthmanOauth/AuthmanOauthPluginBase.php
<?php
declare(strict_types = 1);
namespace Drupal\authman\Plugin\AuthmanOauth;
use Drupal\Core\Plugin\PluginBase;
use Drupal\Core\Plugin\PluginWithFormsTrait;
/**
* Common implementation for OAuth plugins.
*/
abstract class AuthmanOauthPluginBase extends PluginBase implements AuthmanOauthPluginInterface {
use PluginWithFormsTrait;
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->setConfiguration($configuration);
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {
$this->configuration = $configuration + $this->defaultConfiguration();
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
return [];
}
}
