EncryptionMethodBase.php in Encrypt 8.3
File
src/Plugin/EncryptionMethod/EncryptionMethodBase.php
View source
<?php
namespace Drupal\encrypt\Plugin\EncryptionMethod;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Plugin\PluginBase;
use Drupal\encrypt\EncryptionMethodInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class EncryptionMethodBase extends PluginBase implements EncryptionMethodInterface, ConfigurableInterface, DependentPluginInterface {
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configuration = NestedArray::mergeDeep($this
->defaultConfiguration(), $this->configuration);
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition);
}
public function getLabel() {
return $this->pluginDefinition['title'];
}
public function defaultConfiguration() {
return [];
}
public function getConfiguration() {
return $this->configuration;
}
public function setConfiguration(array $configuration) {
$this->configuration = $configuration;
}
public function calculateDependencies() {
return [];
}
public function canDecrypt() {
return $this->pluginDefinition['can_decrypt'];
}
public function isDeprecated() {
return $this->pluginDefinition['deprecated'];
}
}