Commit 4bb82a8e authored by alexpott's avatar alexpott

Issue #2946122 by mikelutz, heddn, tim.plunkett, phenaproxima, alexpott,...

Issue #2946122 by mikelutz, heddn, tim.plunkett, phenaproxima, alexpott, joelpittet, MegaChriz, joachim, xjm: Deprecate ConfigurablePluginInterface and replace with an interface that doesn't extend DependentPluginInterface
parent ad0506ce
......@@ -1382,7 +1382,8 @@
* instantiated. Usually this interface will extend one or more of the
* following interfaces:
* - \Drupal\Component\Plugin\PluginInspectionInterface
* - \Drupal\Component\Plugin\ConfigurablePluginInterface
* - \Drupal\Component\Plugin\ConfigurableInterface
* - \Drupal\Component\Plugin\DependentPluginInterface
* - \Drupal\Component\Plugin\ContextAwarePluginInterface
* - \Drupal\Core\Plugin\PluginFormInterface
* - \Drupal\Core\Executable\ExecutableInterface
......
<?php
namespace Drupal\Component\Plugin;
/**
* Provides an interface for a configurable plugin.
*
* @ingroup plugin_api
*/
interface ConfigurableInterface {
/**
* Gets this plugin's configuration.
*
* @return array
* An array of this plugin's configuration.
*/
public function getConfiguration();
/**
* Sets the configuration for this plugin instance.
*
* @param array $configuration
* An associative array containing the plugin's configuration.
*/
public function setConfiguration(array $configuration);
/**
* Gets default configuration for this plugin.
*
* @return array
* An associative array with the default configuration.
*/
public function defaultConfiguration();
}
......@@ -5,6 +5,15 @@
/**
* Provides an interface for a configurable plugin.
*
* @deprecated Drupal\Component\Plugin\ConfigurablePluginInterface is deprecated
* in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement
* ConfigurableInterface and/or DependentPluginInterface directly as needed. If
* you implement ConfigurableInterface you may choose to implement
* ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility,
* however this must be removed prior to Drupal 9.
*
* @see https://www.drupal.org/node/2946161
*
* @ingroup plugin_api
*/
interface ConfigurablePluginInterface extends DependentPluginInterface {
......
......@@ -30,7 +30,7 @@ abstract class PluginBase implements PluginInspectionInterface, DerivativeInspec
* Configuration information passed into the plugin.
*
* When using an interface like
* \Drupal\Component\Plugin\ConfigurablePluginInterface, this is where the
* \Drupal\Component\Plugin\ConfigurableInterface, this is where the
* configuration should be stored.
*
* Plugin configuration is optional, so plugin implementations must provide
......@@ -54,6 +54,10 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
$this->configuration = $configuration;
$this->pluginId = $plugin_id;
$this->pluginDefinition = $plugin_definition;
if ($this instanceof ConfigurablePluginInterface && !$this instanceof ConfigurableInterface) {
@trigger_error('Drupal\Component\Plugin\ConfigurablePluginInterface is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement ConfigurableInterface and/or DependentPluginInterface directly as needed. If you implement ConfigurableInterface you may choose to implement ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility, however this must be removed prior to Drupal 9. See https://www.drupal.org/node/2946161', E_USER_DEPRECATED);
}
}
/**
......@@ -93,4 +97,14 @@ public function getPluginDefinition() {
return $this->pluginDefinition;
}
/**
* Determines if the plugin is configurable.
*
* @return bool
* A boolean indicating whether the plugin is configurable.
*/
public function isConfigurable() {
return $this instanceof ConfigurableInterface || $this instanceof ConfigurablePluginInterface;
}
}
<?php
namespace Drupal\Component\Plugin;
/**
* A helper class to determine if a plugin is configurable.
*
* Because configurable plugins in Drupal 8 might implement either the
* deprecated ConfigurablePluginInterface or the new ConfigurableInterface,
* this static method is provided so that a calling class can determine if a
* plugin is configurable without checking it against a deprecated interface.
* In Drupal 9, this check should be reduced to checking for
* ConfigurableInterface only and be deprecated in favor of calling classes
* checking against the interface directly.
*/
class PluginHelper {
/**
* Determines if a plugin is configurable.
*
* @param mixed $plugin
* The plugin to check.
*
* @return bool
* A boolean indicating whether the plugin is configurable.
*/
public static function isConfigurable($plugin) {
return $plugin instanceof ConfigurableInterface || $plugin instanceof ConfigurablePluginInterface;
}
}
......@@ -2,14 +2,16 @@
namespace Drupal\Core\Action;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginFormInterface;
/**
* Provides a base implementation for a configurable Action plugin.
*/
abstract class ConfigurableActionBase extends ActionBase implements ConfigurablePluginInterface, PluginFormInterface {
abstract class ConfigurableActionBase extends ActionBase implements ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface, PluginFormInterface {
/**
* {@inheritdoc}
......
......@@ -2,10 +2,12 @@
namespace Drupal\Core\Block;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DerivativeInspectionInterface;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginFormInterface;
use Drupal\Core\Session\AccountInterface;
......@@ -20,7 +22,7 @@
*
* @ingroup block_api
*/
interface BlockPluginInterface extends ConfigurablePluginInterface, PluginFormInterface, PluginInspectionInterface, CacheableDependencyInterface, DerivativeInspectionInterface {
interface BlockPluginInterface extends ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface, PluginFormInterface, PluginInspectionInterface, CacheableDependencyInterface, DerivativeInspectionInterface {
/**
* Indicates the block label (title) should be displayed to end users.
......
......@@ -2,7 +2,9 @@
namespace Drupal\Core\Condition;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Executable\ExecutableInterface;
......@@ -42,7 +44,7 @@
*
* @ingroup plugin_api
*/
interface ConditionInterface extends ExecutableInterface, PluginFormInterface, ConfigurablePluginInterface, PluginInspectionInterface, CacheableDependencyInterface {
interface ConditionInterface extends ExecutableInterface, PluginFormInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface, PluginInspectionInterface, CacheableDependencyInterface {
/**
* Determines whether condition result will be negated.
......
......@@ -2,7 +2,9 @@
namespace Drupal\Core\Display;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
use Drupal\Core\Plugin\PluginFormInterface;
......@@ -16,7 +18,7 @@
* @see \Drupal\Core\Display\VariantManager
* @see plugin_api
*/
interface VariantInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface, RefinableCacheableDependencyInterface {
interface VariantInterface extends PluginInspectionInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface, PluginFormInterface, RefinableCacheableDependencyInterface {
/**
* Returns the user-facing display variant label.
......
......@@ -2,7 +2,9 @@
namespace Drupal\Core\Entity\EntityReferenceSelection;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\Core\Form\FormStateInterface;
......@@ -11,7 +13,7 @@
/**
* Provides a base class for configurable selection handlers.
*/
abstract class SelectionPluginBase extends PluginBase implements SelectionInterface, ConfigurablePluginInterface {
abstract class SelectionPluginBase extends PluginBase implements SelectionInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface {
/**
* Constructs a new selection object.
......
......@@ -9,7 +9,7 @@
* Interface definition for plugin with settings.
*
* @deprecated in Drupal 8.1.0 and will be removed before Drupal 9.0.0. Use
* \Drupal\Component\Plugin\ConfigurablePluginInterface instead.
* \Drupal\Component\Plugin\ConfigurableInterface instead.
*/
interface PluginSettingsInterface extends PluginInspectionInterface, ThirdPartySettingsInterface {
......
......@@ -2,14 +2,16 @@
namespace Drupal\Core\Layout;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DerivativeInspectionInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
/**
* Provides an interface for static Layout plugins.
*/
interface LayoutInterface extends PluginInspectionInterface, DerivativeInspectionInterface, ConfigurablePluginInterface {
interface LayoutInterface extends PluginInspectionInterface, DerivativeInspectionInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface {
/**
* Build a render array for layout with regions.
......
......@@ -2,9 +2,9 @@
namespace Drupal\Core\Plugin;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\ContextAwarePluginBase as ComponentContextAwarePluginBase;
use Drupal\Component\Plugin\Exception\ContextException;
use Drupal\Component\Plugin\PluginHelper;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
......@@ -78,7 +78,7 @@ public function setContextValue($name, $value) {
* {@inheritdoc}
*/
public function getContextMapping() {
$configuration = $this instanceof ConfigurablePluginInterface ? $this->getConfiguration() : $this->configuration;
$configuration = PluginHelper::isConfigurable($this) ? $this->getConfiguration() : $this->configuration;
return isset($configuration['context_mapping']) ? $configuration['context_mapping'] : [];
}
......@@ -86,7 +86,7 @@ public function getContextMapping() {
* {@inheritdoc}
*/
public function setContextMapping(array $context_mapping) {
if ($this instanceof ConfigurablePluginInterface) {
if (PluginHelper::isConfigurable($this)) {
$configuration = $this->getConfiguration();
$configuration['context_mapping'] = array_filter($context_mapping);
$this->setConfiguration($configuration);
......
......@@ -4,8 +4,8 @@
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\LazyPluginCollection;
use Drupal\Component\Plugin\PluginHelper;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
......@@ -112,7 +112,7 @@ public function getConfiguration() {
$this->instanceIDs = $this->originalOrder + $current_order;
foreach ($this as $instance_id => $instance) {
if ($instance instanceof ConfigurablePluginInterface) {
if (PluginHelper::isConfigurable($instance)) {
$instances[$instance_id] = $instance->getConfiguration();
}
else {
......@@ -158,7 +158,7 @@ public function setConfiguration($configuration) {
public function setInstanceConfiguration($instance_id, array $configuration) {
$this->configurations[$instance_id] = $configuration;
$instance = $this->get($instance_id);
if ($instance instanceof ConfigurablePluginInterface) {
if (PluginHelper::isConfigurable($instance)) {
$instance->setConfiguration($configuration);
}
}
......
......@@ -2,9 +2,9 @@
namespace Drupal\Core\Plugin;
use Drupal\Component\Plugin\PluginHelper;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Component\Plugin\LazyPluginCollection;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
......@@ -67,7 +67,7 @@ protected function initializePlugin($instance_id) {
*/
public function getConfiguration() {
$plugin = $this->get($this->instanceId);
if ($plugin instanceof ConfigurablePluginInterface) {
if (PluginHelper::isConfigurable($plugin)) {
return $plugin->getConfiguration();
}
else {
......@@ -81,7 +81,7 @@ public function getConfiguration() {
public function setConfiguration($configuration) {
$this->configuration = $configuration;
$plugin = $this->get($this->instanceId);
if ($plugin instanceof ConfigurablePluginInterface) {
if (PluginHelper::isConfigurable($plugin)) {
$plugin->setConfiguration($configuration);
}
return $this;
......
......@@ -2,7 +2,9 @@
namespace Drupal\aggregator\Plugin;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\PluginBase;
use Drupal\Core\Plugin\PluginFormInterface;
......@@ -19,7 +21,7 @@
* @see \Drupal\aggregator\Plugin\ParserInterface
* @see plugin_api
*/
abstract class AggregatorPluginSettingsBase extends PluginBase implements PluginFormInterface, ConfigurablePluginInterface {
abstract class AggregatorPluginSettingsBase extends PluginBase implements PluginFormInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface {
/**
* {@inheritdoc}
......
......@@ -2,8 +2,10 @@
namespace Drupal\filter\Plugin;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Core\Form\FormStateInterface;
/**
......@@ -75,7 +77,7 @@
* @see \Drupal\filter\Plugin\FilterBase
* @see plugin_api
*/
interface FilterInterface extends ConfigurablePluginInterface, PluginInspectionInterface {
interface FilterInterface extends ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface, PluginInspectionInterface {
/**
* Non-HTML markup language filters that generate HTML.
......
......@@ -2,7 +2,9 @@
namespace Drupal\image;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Image\ImageInterface;
......@@ -16,7 +18,7 @@
* @see \Drupal\image\ImageEffectManager
* @see plugin_api
*/
interface ImageEffectInterface extends PluginInspectionInterface, ConfigurablePluginInterface {
interface ImageEffectInterface extends PluginInspectionInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface {
/**
* Applies an image effect to the image object.
......
......@@ -2,7 +2,9 @@
namespace Drupal\media;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
......@@ -66,7 +68,7 @@
* @see \Drupal\media\MediaSourceFieldConstraintsInterface
* @see plugin_api
*/
interface MediaSourceInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface {
interface MediaSourceInterface extends PluginInspectionInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface, PluginFormInterface {
/**
* Default empty value for metadata fields.
......
......@@ -2,13 +2,15 @@
namespace Drupal\search\Plugin;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Core\Plugin\PluginFormInterface;
/**
* Provides an interface for a configurable Search plugin.
*/
interface ConfigurableSearchPluginInterface extends ConfigurablePluginInterface, PluginFormInterface, SearchInterface {
interface ConfigurableSearchPluginInterface extends ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface, PluginFormInterface, SearchInterface {
/**
* Sets the ID for the search page using this plugin.
......
......@@ -2,12 +2,12 @@
namespace Drupal\system\Entity;
use Drupal\Component\Plugin\PluginHelper;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Entity\EntityWithPluginCollectionInterface;
use Drupal\system\ActionConfigEntityInterface;
use Drupal\Core\Action\ActionPluginCollection;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
/**
* Defines the configured action entity.
......@@ -133,7 +133,7 @@ public function execute(array $entities) {
* {@inheritdoc}
*/
public function isConfigurable() {
return $this->getPlugin() instanceof ConfigurablePluginInterface;
return PluginHelper::isConfigurable($this->getPlugin());
}
/**
......
......@@ -2,14 +2,16 @@
namespace Drupal\workflows;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\DerivativeInspectionInterface;
use Drupal\Core\Plugin\PluginWithFormsInterface;
/**
* An interface for Workflow type plugins.
*/
interface WorkflowTypeInterface extends PluginWithFormsInterface, DerivativeInspectionInterface, ConfigurablePluginInterface {
interface WorkflowTypeInterface extends PluginWithFormsInterface, DerivativeInspectionInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface {
/**
* The key of the global workflow plugin form.
......
<?php
namespace Drupal\Tests\Component\Plugin;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\PluginBase;
use PHPUnit\Framework\TestCase;
/**
* Tests ConfigurablePluginInterface deprecation.
*
* @group legacy
* @group plugin
*/
class ConfigurablePluginInterfaceTest extends TestCase {
/**
* Tests the deprecation error is thrown.
*
* @expectedDeprecation Drupal\Component\Plugin\ConfigurablePluginInterface is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. You should implement ConfigurableInterface and/or DependentPluginInterface directly as needed. If you implement ConfigurableInterface you may choose to implement ConfigurablePluginInterface in Drupal 8 as well for maximum compatibility, however this must be removed prior to Drupal 9. See https://www.drupal.org/node/2946161
*/
public function testDeprecation() {
new ConfigurablePluginInterfaceTestClass([], '', []);
}
}
/**
* Test Class to trigger deprecation error.
*/
class ConfigurablePluginInterfaceTestClass extends PluginBase implements ConfigurablePluginInterface {
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
return [];
}
}
......@@ -7,7 +7,8 @@
namespace Drupal\Tests\Core\Plugin;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionInterface;
use Drupal\Component\Plugin\Definition\ContextAwarePluginDefinitionTrait;
use Drupal\Component\Plugin\Definition\PluginDefinition;
......@@ -554,7 +555,7 @@ public function testApplyContextMappingConfigurableAssignedMiss() {
}
interface TestConfigurableContextAwarePluginInterface extends ContextAwarePluginInterface, ConfigurablePluginInterface {
interface TestConfigurableContextAwarePluginInterface extends ContextAwarePluginInterface, ConfigurableInterface, DependentPluginInterface {
}
......
......@@ -2,7 +2,11 @@
namespace Drupal\Tests\Core\Plugin;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Plugin\DefaultLazyPluginCollection;
use Drupal\Tests\Core\Plugin\Fixtures\TestConfigurablePlugin;
/**
......@@ -14,7 +18,7 @@ class DefaultLazyPluginCollectionTest extends LazyPluginCollectionTestBase {
/**
* Stores all setup plugin instances.
*
* @var \Drupal\Component\Plugin\ConfigurablePluginInterface[]
* @var \Drupal\Component\Plugin\ConfigurableInterface[]
*/
protected $pluginInstances;
......@@ -234,4 +238,32 @@ public function testConfigurableSetConfiguration() {
}
/**
* Tests that plugin methods are correctly attached to interfaces.
*
* @covers ::getConfiguration
*/
public function testConfigurableInterface() {
$configurable_plugin = $this->prophesize(ConfigurableInterface::class);
$configurable_config = ['id' => 'configurable', 'foo' => 'bar'];
$configurable_plugin->getConfiguration()->willReturn($configurable_config);
$nonconfigurable_plugin = $this->prophesize(PluginInspectionInterface::class);
$nonconfigurable_config = ['id' => 'non-configurable', 'baz' => 'qux'];
$nonconfigurable_plugin->configuration = $nonconfigurable_config;
$configurations = [
'configurable' => $configurable_config,
'non-configurable' => $nonconfigurable_config,
];
$plugin_manager = $this->prophesize(PluginManagerInterface::class);
$plugin_manager->createInstance('configurable', $configurable_config)->willReturn($configurable_plugin->reveal());
$plugin_manager->createInstance('non-configurable', $nonconfigurable_config)->willReturn($nonconfigurable_plugin->reveal());
$collection = new DefaultLazyPluginCollection($plugin_manager->reveal(), $configurations);
$this->assertSame($configurations, $collection->getConfiguration());
}
}
......@@ -2,7 +2,7 @@
namespace Drupal\Tests\Core\Plugin;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Core\Plugin\DefaultSingleLazyPluginCollection;
......@@ -71,7 +71,7 @@ public function testGetInstanceIds() {
}
class ConfigurablePlugin extends PluginBase implements ConfigurablePluginInterface {
class ConfigurablePlugin extends PluginBase implements ConfigurableInterface {
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
......@@ -91,8 +91,4 @@ public function setConfiguration(array $configuration) {
$this->configuration = $configuration;
}
public function calculateDependencies() {
return [];
}
}
......@@ -2,10 +2,11 @@
namespace Drupal\Tests\Core\Plugin\Fixtures;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\PluginBase;
class TestConfigurablePlugin extends PluginBase implements ConfigurablePluginInterface {
class TestConfigurablePlugin extends PluginBase implements ConfigurableInterface, DependentPluginInterface {
/**
* {@inheritdoc}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment