diff --git a/core/lib/Drupal/Component/Plugin/Derivative/DerivativeBase.php b/core/lib/Drupal/Component/Plugin/Derivative/DeriverBase.php similarity index 64% rename from core/lib/Drupal/Component/Plugin/Derivative/DerivativeBase.php rename to core/lib/Drupal/Component/Plugin/Derivative/DeriverBase.php index 3adc1507d36f44e5ed2496e9556c290d19c8266e..f989bf6ccc831b03149b6bcbb0cbbafa5702af23 100644 --- a/core/lib/Drupal/Component/Plugin/Derivative/DerivativeBase.php +++ b/core/lib/Drupal/Component/Plugin/Derivative/DeriverBase.php @@ -2,20 +2,15 @@ /** * @file - * Contains Drupal\Component\Plugin\Derivative\DerivativeBase. + * Contains \Drupal\Component\Plugin\Derivative\DeriverBase. */ namespace Drupal\Component\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeInterface; - /** - * Default version of getDerivativeDefinition() common to most concrete - * implementations of DerivativeInterface. - * - * See the Aggregator and Mock block derivers for different implementations. + * Provides a basic deriver. */ -abstract class DerivativeBase implements DerivativeInterface { +abstract class DeriverBase implements DeriverInterface { /** * List of derivative definitions. diff --git a/core/lib/Drupal/Component/Plugin/Derivative/DerivativeInterface.php b/core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php similarity index 88% rename from core/lib/Drupal/Component/Plugin/Derivative/DerivativeInterface.php rename to core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php index e4b92b0a1e5df46092dc9dac0c57c156f902a088..fe9ef400654d8cf8a854b14d46d4f07bf9228770 100644 --- a/core/lib/Drupal/Component/Plugin/Derivative/DerivativeInterface.php +++ b/core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php @@ -2,17 +2,17 @@ /** * @file - * Definition of Drupal\Component\Plugin\Derivative\DerivativeInterface. + * Contains \Drupal\Component\Plugin\Derivative\DeriverInterface. */ namespace Drupal\Component\Plugin\Derivative; /** - * Plugin interface for derivative plugin handling. + * Provides additional plugin definitions based on an existing definition. * * @ingroup plugin_api */ -interface DerivativeInterface { +interface DeriverInterface { /** * Returns the definition of a derivative plugin. diff --git a/core/lib/Drupal/Component/Plugin/DerivativeInspectionInterface.php b/core/lib/Drupal/Component/Plugin/DerivativeInspectionInterface.php index 4dbd9d5a7e9f522b36bb641ff90755077cf6f4dc..db2205a2206465b7ca349463ee826e3fc28a2a36 100644 --- a/core/lib/Drupal/Component/Plugin/DerivativeInspectionInterface.php +++ b/core/lib/Drupal/Component/Plugin/DerivativeInspectionInterface.php @@ -18,7 +18,7 @@ interface DerivativeInspectionInterface { * @return string * The base_plugin_id of the plugin instance. */ - public function getBasePluginId(); + public function getBaseId(); /** * Returns the derivative_id of the plugin instance. diff --git a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php index 4850076ea39b6defcd54384a88ad95cc9c220b72..53a1bef0c4fe50df9d6a4c4b6fad593095eff2ea 100644 --- a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php +++ b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php @@ -7,7 +7,7 @@ namespace Drupal\Component\Plugin\Discovery; -use Drupal\Component\Plugin\Exception\InvalidDerivativeClassException; +use Drupal\Component\Plugin\Exception\InvalidDeriverException; /** * Base class providing the tools for a plugin discovery to be derivative aware. @@ -19,14 +19,25 @@ class DerivativeDiscoveryDecorator implements DiscoveryInterface { use DiscoveryTrait; - protected $derivativeFetchers = array(); + /** + * Plugin derivers. + * + * @var \Drupal\Component\Plugin\Derivative\DeriverInterface[] + * Keys are base plugin IDs. + */ + protected $derivers = array(); + + /** + * The decorated plugin discovery. + * + * @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface + */ protected $decorated; /** - * Creates a Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator - * object. + * Creates a new instance. * - * @param DiscoveryInterface $discovery + * @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated * The parent object implementing DiscoveryInterface that is being * decorated. */ @@ -37,9 +48,9 @@ public function __construct(DiscoveryInterface $decorated) { /** * {@inheritdoc} * - * @throws \Drupal\Component\Plugin\Exception\InvalidDerivativeClassException - * Thrown if the 'derivative' class specified in the plugin definition does - * not implement \Drupal\Component\Plugin\Derivative\DerivativeInterface. + * @throws \Drupal\Component\Plugin\Exception\InvalidDeriverException + * Thrown if the 'deriver' class specified in the plugin definition + * does not implement \Drupal\Component\Plugin\Derivative\DeriverInterface. */ public function getDefinition($plugin_id, $exception_on_invalid = TRUE) { // This check is only for derivative plugins that have explicitly provided @@ -51,9 +62,9 @@ public function getDefinition($plugin_id, $exception_on_invalid = TRUE) { list($base_plugin_id, $derivative_id) = $this->decodePluginId($plugin_id); $base_plugin_definition = $this->decorated->getDefinition($base_plugin_id, $exception_on_invalid); if ($base_plugin_definition) { - $derivative_fetcher = $this->getDerivativeFetcher($base_plugin_id, $base_plugin_definition); - if ($derivative_fetcher) { - $derivative_plugin_definition = $derivative_fetcher->getDerivativeDefinition($derivative_id, $base_plugin_definition); + $deriver = $this->getDeriver($base_plugin_id, $base_plugin_definition); + if ($deriver) { + $derivative_plugin_definition = $deriver->getDerivativeDefinition($derivative_id, $base_plugin_definition); // If a plugin defined itself as a derivative, merge in possible // defaults from the derivative. if ($derivative_id && isset($plugin_definition)) { @@ -71,9 +82,9 @@ public function getDefinition($plugin_id, $exception_on_invalid = TRUE) { /** * {@inheritdoc} * - * @throws \Drupal\Component\Plugin\Exception\InvalidDerivativeClassException - * Thrown if the 'derivative' class specified in the plugin definition does - * not implement \Drupal\Component\Plugin\Derivative\DerivativeInterface. + * @throws \Drupal\Component\Plugin\Exception\InvalidDeriverException + * Thrown if the 'deriver' class specified in the plugin definition + * does not implement \Drupal\Component\Plugin\Derivative\DeriverInterface. */ public function getDefinitions() { $plugin_definitions = $this->decorated->getDefinitions(); @@ -89,9 +100,9 @@ public function getDefinitions() { protected function getDerivatives(array $base_plugin_definitions) { $plugin_definitions = array(); foreach ($base_plugin_definitions as $base_plugin_id => $plugin_definition) { - $derivative_fetcher = $this->getDerivativeFetcher($base_plugin_id, $plugin_definition); - if ($derivative_fetcher) { - $derivative_definitions = $derivative_fetcher->getDerivativeDefinitions($plugin_definition); + $deriver = $this->getDeriver($base_plugin_id, $plugin_definition); + if ($deriver) { + $derivative_definitions = $deriver->getDerivativeDefinitions($plugin_definition); foreach ($derivative_definitions as $derivative_id => $derivative_definition) { $plugin_id = $this->encodePluginId($base_plugin_id, $derivative_id); // Use this definition as defaults if a plugin already defined @@ -155,52 +166,51 @@ protected function encodePluginId($base_plugin_id, $derivative_id) { } /** - * Finds a Drupal\Component\Plugin\Discovery\DerivativeInterface. - * - * This Drupal\Component\Plugin\Discovery\DerivativeInterface can fetch - * derivatives for the plugin. + * Gets a deriver for a base plugin. * * @param string $base_plugin_id * The base plugin id of the plugin. * @param mixed $base_definition * The base plugin definition to build derivatives. * - * @return \Drupal\Component\Plugin\Derivative\DerivativeInterface|null + * @return \Drupal\Component\Plugin\Derivative\DeriverInterface|null * A DerivativeInterface or NULL if none exists for the plugin. * - * @throws \Drupal\Component\Plugin\Exception\InvalidDerivativeClassException - * Thrown if the 'derivative' class specified in the plugin definition does - * not implement \Drupal\Component\Plugin\Derivative\DerivativeInterface. + * @throws \Drupal\Component\Plugin\Exception\InvalidDeriverException + * Thrown if the 'deriver' class specified in the plugin definition + * does not implement \Drupal\Component\Plugin\Derivative\DeriverInterface. */ - protected function getDerivativeFetcher($base_plugin_id, $base_definition) { - if (!isset($this->derivativeFetchers[$base_plugin_id])) { - $this->derivativeFetchers[$base_plugin_id] = FALSE; - $class = $this->getDerivativeClass($base_definition); + protected function getDeriver($base_plugin_id, $base_definition) { + if (!isset($this->derivers[$base_plugin_id])) { + $this->derivers[$base_plugin_id] = FALSE; + $class = $this->getDeriverClass($base_definition); if ($class) { - $this->derivativeFetchers[$base_plugin_id] = new $class($base_plugin_id); + $this->derivers[$base_plugin_id] = new $class($base_plugin_id); } } - return $this->derivativeFetchers[$base_plugin_id] ?: NULL; + return $this->derivers[$base_plugin_id] ?: NULL; } /** - * Get the derivative class name from the base plugin definition. + * Get the deriver class name from the base plugin definition. * * @param array $base_definition * The base plugin definition to build derivatives. * - * @return string|NULL - * The name of a class implementing \Drupal\Component\Plugin\Derivative\DerivativeInterface. + * @return string|null + * The name of a class implementing + * \Drupal\Component\Plugin\Derivative\DeriverInterface. * - * @throws \Drupal\Component\Plugin\Exception\InvalidDerivativeClassException - * Thrown if the 'derivative' class specified in the plugin definition does - * not implement \Drupal\Component\Plugin\Derivative\DerivativeInterface. + * @throws \Drupal\Component\Plugin\Exception\InvalidDeriverException + * Thrown if the 'deriver' class specified in the plugin definition + * does not implement + * \Drupal\Component\Plugin\Derivative\DerivativeInterface. */ - protected function getDerivativeClass($base_definition) { + protected function getDeriverClass($base_definition) { $class = NULL; - if ((is_array($base_definition) || ($base_definition = (array) $base_definition)) && (isset($base_definition['derivative']) && $class = $base_definition['derivative'])) { - if (!is_subclass_of($class, '\Drupal\Component\Plugin\Derivative\DerivativeInterface')) { - throw new InvalidDerivativeClassException(sprintf('Plugin (%s) derivative class "%s" has to implement interface \Drupal\Component\Plugin\Derivative\DerivativeInterface', $base_definition['id'], $class)); + if ((is_array($base_definition) || ($base_definition = (array) $base_definition)) && (isset($base_definition['deriver']) && $class = $base_definition['deriver'])) { + if (!is_subclass_of($class, '\Drupal\Component\Plugin\Derivative\DeriverInterface')) { + throw new InvalidDeriverException(sprintf('Plugin (%s) deriver "%s" must implement \Drupal\Component\Plugin\Derivative\DeriverInterface', $base_definition['id'], $class)); } } return $class; diff --git a/core/lib/Drupal/Component/Plugin/Exception/InvalidDerivativeClassException.php b/core/lib/Drupal/Component/Plugin/Exception/InvalidDeriverException.php similarity index 66% rename from core/lib/Drupal/Component/Plugin/Exception/InvalidDerivativeClassException.php rename to core/lib/Drupal/Component/Plugin/Exception/InvalidDeriverException.php index e3f7ed0a1d9c31e227cd992e8bb33f3833884b2f..4aab38095de97c3bc434f1c4a0782f78c5e7f6f9 100644 --- a/core/lib/Drupal/Component/Plugin/Exception/InvalidDerivativeClassException.php +++ b/core/lib/Drupal/Component/Plugin/Exception/InvalidDeriverException.php @@ -1,12 +1,12 @@ getPluginId(); if (strpos($plugin_id, static::DERIVATIVE_SEPARATOR)) { list($plugin_id) = explode(static::DERIVATIVE_SEPARATOR, $plugin_id, 2); diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php index 214a63a1016910320218964fd8205733ba33bb4f..dc54e75f417eec6c3cbd0ccaa59a1a53385fa026 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php +++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php @@ -8,13 +8,13 @@ namespace Drupal\Core\Entity\Plugin\DataType\Deriver; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides data type plugins for each existing entity type and bundle. */ -class EntityDeriver implements ContainerDerivativeInterface { +class EntityDeriver implements ContainerDeriverInterface { /** * List of derivative definitions. diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php index 785cde97e1b7f3352d83cdd3d3ee372f5c9b8ea2..5755c51d123e1d16895dc25d1d26d6fb06a3f59d 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php +++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/Entity.php @@ -17,7 +17,7 @@ * id = "entity", * label = @Translation("Entity"), * description = @Translation("All kind of entities, e.g. nodes, comments or users."), - * derivative = "\Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver", + * deriver = "\Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver", * definition_class = "\Drupal\Core\Entity\TypedData\EntityDataDefinition" * ) */ diff --git a/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php b/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php index 09207f169d9be0636825902b92979a40d30a845f..19d44e424460ffb02d17d1ccb729d45d9915944a 100644 --- a/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php +++ b/core/lib/Drupal/Core/Field/Plugin/DataType/Deriver/FieldItemDeriver.php @@ -8,13 +8,13 @@ namespace Drupal\Core\Field\Plugin\DataType\Deriver; use Drupal\Core\Field\FieldTypePluginManagerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides data type plugins for each existing field type plugin. */ -class FieldItemDeriver implements ContainerDerivativeInterface { +class FieldItemDeriver implements ContainerDeriverInterface { /** * List of derivative definitions. diff --git a/core/lib/Drupal/Core/Field/Plugin/DataType/FieldItem.php b/core/lib/Drupal/Core/Field/Plugin/DataType/FieldItem.php index 8f5c7d579c4102c018f2cee2d2f3630e12763be8..bcca2ecbac51d42eee790e7dfd940f9b1d9ef141 100644 --- a/core/lib/Drupal/Core/Field/Plugin/DataType/FieldItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/DataType/FieldItem.php @@ -18,7 +18,7 @@ * id = "field_item", * label = @Translation("Field item"), * list_class = "\Drupal\Core\Field\FieldItemList", - * derivative = "Drupal\Core\Field\Plugin\DataType\Deriver\FieldItemDeriver" + * deriver = "Drupal\Core\Field\Plugin\DataType\Deriver\FieldItemDeriver" * ) */ abstract class FieldItem { diff --git a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php index b01d1aceb6240637297783bf2f537f1ee2e47537..6951c773fe617d4530813f7adc641444aa2abefc 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php @@ -14,22 +14,22 @@ class ContainerDerivativeDiscoveryDecorator extends DerivativeDiscoveryDecorator /** * {@inheritdoc} */ - protected function getDerivativeFetcher($base_plugin_id, $base_definition) { - if (!isset($this->derivativeFetchers[$base_plugin_id])) { - $this->derivativeFetchers[$base_plugin_id] = FALSE; - $class = $this->getDerivativeClass($base_definition); + protected function getDeriver($base_plugin_id, $base_definition) { + if (!isset($this->derivers[$base_plugin_id])) { + $this->derivers[$base_plugin_id] = FALSE; + $class = $this->getDeriverClass($base_definition); if ($class) { - // If the derivative class provides a factory method, pass the container - // to it. - if (is_subclass_of($class, 'Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface')) { - $this->derivativeFetchers[$base_plugin_id] = $class::create(\Drupal::getContainer(), $base_plugin_id); + // If the deriver provides a factory method, pass the container to it. + if (is_subclass_of($class, '\Drupal\Core\Plugin\Discovery\ContainerDeriverInterface')) { + /** @var \Drupal\Core\Plugin\Discovery\ContainerDeriverInterface $class */ + $this->derivers[$base_plugin_id] = $class::create(\Drupal::getContainer(), $base_plugin_id); } else { - $this->derivativeFetchers[$base_plugin_id] = new $class($base_plugin_id); + $this->derivers[$base_plugin_id] = new $class($base_plugin_id); } } } - return $this->derivativeFetchers[$base_plugin_id] ?: NULL; + return $this->derivers[$base_plugin_id] ?: NULL; } } diff --git a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeInterface.php b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDeriverInterface.php similarity index 57% rename from core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeInterface.php rename to core/lib/Drupal/Core/Plugin/Discovery/ContainerDeriverInterface.php index c3f747345a4ef36d54aa89d0503af6eb924940be..e0e9ee7369c721246beba0739f0b34fca12926f3 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeInterface.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/ContainerDeriverInterface.php @@ -2,25 +2,26 @@ /** * @file - * Contains \Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface. + * Contains \Drupal\Core\Plugin\Discovery\ContainerDeriverInterface. */ namespace Drupal\Core\Plugin\Discovery; -use Drupal\Component\Plugin\Derivative\DerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Derivative fetcher interface to pass the container to static create method. + * Provides additional plugin definitions based on an existing definition using + * service injection. */ -interface ContainerDerivativeInterface extends DerivativeInterface { +interface ContainerDeriverInterface extends DeriverInterface { /** - * Creates an instance of the derivative fetcher. + * Creates a new class instance. * * @param \Symfony\Component\DependencyInjection\ContainerInterface $container * The container to pull out services used in the fetcher. - * @param string $plugin_id + * @param string $base_plugin_id * The base plugin ID for the plugin ID. * * @return static diff --git a/core/modules/block/block.local_tasks.yml b/core/modules/block/block.local_tasks.yml index ca6917b680f3503cccbd3db4236a8a2cbc5a34bb..efba19ca9f308936af15ff24ee3ff55451a73177 100644 --- a/core/modules/block/block.local_tasks.yml +++ b/core/modules/block/block.local_tasks.yml @@ -12,4 +12,4 @@ block.admin_display_theme: title: 'Block layout' route_name: block.admin_display_theme parent_id: block.admin_display - derivative: 'Drupal\block\Plugin\Derivative\ThemeLocalTask' + deriver: 'Drupal\block\Plugin\Derivative\ThemeLocalTask' diff --git a/core/modules/block/custom_block/src/Plugin/Derivative/CustomBlock.php b/core/modules/block/custom_block/src/Plugin/Derivative/CustomBlock.php new file mode 100644 index 0000000000000000000000000000000000000000..976703d8c82f703acd6a800da23eb75f84ca5d22 --- /dev/null +++ b/core/modules/block/custom_block/src/Plugin/Derivative/CustomBlock.php @@ -0,0 +1,28 @@ +derivatives[$custom_block->uuid()] = $base_plugin_definition; + $this->derivatives[$custom_block->uuid()]['admin_label'] = $custom_block->label(); + } + return parent::getDerivativeDefinitions($base_plugin_definition); + } +} diff --git a/core/modules/block/src/BlockPluginInterface.php b/core/modules/block/src/BlockPluginInterface.php index 9f3090a0a7b3756f243ff9dc72e307691b2f7d2a..f1a94caf1d434db44694dfaaf00311ce68e5e40b 100644 --- a/core/modules/block/src/BlockPluginInterface.php +++ b/core/modules/block/src/BlockPluginInterface.php @@ -8,6 +8,7 @@ namespace Drupal\block; use Drupal\Component\Plugin\Context\ContextInterface; +use Drupal\Component\Plugin\DerivativeInspectionInterface; use Drupal\Core\Cache\CacheableInterface; use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Component\Plugin\ConfigurablePluginInterface; @@ -24,7 +25,7 @@ * * @ingroup block_api */ -interface BlockPluginInterface extends ConfigurablePluginInterface, PluginFormInterface, PluginInspectionInterface, CacheableInterface { +interface BlockPluginInterface extends ConfigurablePluginInterface, PluginFormInterface, PluginInspectionInterface, CacheableInterface, DerivativeInspectionInterface { /** * Returns the user-facing block label. diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php index 3a1eb04a22817fc4ceb05b864d4d5cc1cdad90d4..de1b5feea524d47d03d1e0e2c17d8637ce065fea 100644 --- a/core/modules/block/src/BlockViewBuilder.php +++ b/core/modules/block/src/BlockViewBuilder.php @@ -37,12 +37,13 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N * {@inheritdoc} */ public function viewMultiple(array $entities = array(), $view_mode = 'full', $langcode = NULL) { + /** @var \Drupal\block\BlockInterface[] $entities */ $build = array(); foreach ($entities as $entity) { $entity_id = $entity->id(); $plugin = $entity->getPlugin(); $plugin_id = $plugin->getPluginId(); - $base_id = $plugin->getBasePluginId(); + $base_id = $plugin->getBaseId(); $derivative_id = $plugin->getDerivativeId(); $configuration = $plugin->getConfiguration(); diff --git a/core/modules/block/src/Plugin/Derivative/ThemeLocalTask.php b/core/modules/block/src/Plugin/Derivative/ThemeLocalTask.php index be4cad56aac3df98994576622e55d009363f0b3e..849df45cdfe0879b5f2020e7df80b26086e9d432 100644 --- a/core/modules/block/src/Plugin/Derivative/ThemeLocalTask.php +++ b/core/modules/block/src/Plugin/Derivative/ThemeLocalTask.php @@ -7,16 +7,16 @@ namespace Drupal\block\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Extension\ThemeHandlerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides dynamic tabs based on active themes. */ -class ThemeLocalTask extends DerivativeBase implements ContainerDerivativeInterface { +class ThemeLocalTask extends DeriverBase implements ContainerDeriverInterface { /** * Stores the theme settings config object. diff --git a/core/modules/block/src/Tests/BlockPreprocessUnitTest.php b/core/modules/block/src/Tests/BlockPreprocessUnitTest.php index e3430195eda8e5334b24c5b975b3ce41d1190828..abae83fdf4062f52c54e4374abeace4dc82366b9 100644 --- a/core/modules/block/src/Tests/BlockPreprocessUnitTest.php +++ b/core/modules/block/src/Tests/BlockPreprocessUnitTest.php @@ -37,6 +37,7 @@ function testBlockClasses() { // an underscore (not transformed) and a hyphen (transformed to underscore), // and generates possibilities for each level of derivative. // @todo Clarify this comment. + /** @var \Drupal\block\BlockInterface $block */ $block = entity_create('block', array( 'plugin' => 'system_menu_block:admin', 'region' => 'footer', @@ -48,7 +49,7 @@ function testBlockClasses() { $plugin = $block->getPlugin(); $variables['elements']['#configuration'] = $plugin->getConfiguration(); $variables['elements']['#plugin_id'] = $plugin->getPluginId(); - $variables['elements']['#base_plugin_id'] = $plugin->getBasePluginId(); + $variables['elements']['#base_plugin_id'] = $plugin->getBaseId(); $variables['elements']['#derivative_plugin_id'] = $plugin->getDerivativeId(); $variables['elements']['content'] = array(); diff --git a/core/modules/block/src/Tests/BlockTemplateSuggestionsUnitTest.php b/core/modules/block/src/Tests/BlockTemplateSuggestionsUnitTest.php index a3f77b411a2118a6a6706c1ff394528ac44a5654..a80e09b47e94752aee94035baf3bacd238692538 100644 --- a/core/modules/block/src/Tests/BlockTemplateSuggestionsUnitTest.php +++ b/core/modules/block/src/Tests/BlockTemplateSuggestionsUnitTest.php @@ -37,6 +37,7 @@ function testBlockThemeHookSuggestions() { // an underscore (not transformed) and a hyphen (transformed to underscore), // and generates possibilities for each level of derivative. // @todo Clarify this comment. + /** @var \Drupal\block\BlockInterface $block */ $block = entity_create('block', array( 'plugin' => 'system_menu_block:admin', 'region' => 'footer', @@ -48,7 +49,7 @@ function testBlockThemeHookSuggestions() { $variables['elements']['#configuration'] = $plugin->getConfiguration(); $variables['elements']['#plugin_id'] = $plugin->getPluginId(); $variables['elements']['#id'] = $block->id(); - $variables['elements']['#base_plugin_id'] = $plugin->getBasePluginId(); + $variables['elements']['#base_plugin_id'] = $plugin->getBaseId(); $variables['elements']['#derivative_plugin_id'] = $plugin->getDerivativeId(); $variables['elements']['content'] = array(); $suggestions = block_theme_suggestions_block($variables); diff --git a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php index 9f3d92dbb068434800db2e4171be691888103d22..49a53dc91a8d8e091a4ce0b305803fcaa91d53c7 100644 --- a/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php +++ b/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php @@ -23,7 +23,7 @@ * id = "block_content", * admin_label = @Translation("Custom block"), * category = @Translation("Custom"), - * derivative = "Drupal\block_content\Plugin\Derivative\BlockContent" + * deriver = "Drupal\block_content\Plugin\Derivative\BlockContent" * ) */ class BlockContentBlock extends BlockBase implements ContainerFactoryPluginInterface { diff --git a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php index a7c17849be1e9b19efb3d054eb121fe434767b9e..f77a297d42dfc6a14653036bbe1c00e02f4b9e0b 100644 --- a/core/modules/block_content/src/Plugin/Derivative/BlockContent.php +++ b/core/modules/block_content/src/Plugin/Derivative/BlockContent.php @@ -7,13 +7,12 @@ namespace Drupal\block_content\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; /** * Retrieves block plugin definitions for all custom blocks. */ -class BlockContent extends DerivativeBase { +class BlockContent extends DeriverBase { /** * {@inheritdoc} */ diff --git a/core/modules/config_translation/config_translation.contextual_links.yml b/core/modules/config_translation/config_translation.contextual_links.yml index ecdc1cd1d8ec0a01a114861ff8d6fd51465ac3d3..71c4544fdd80c68c83828f25ab89baf88d89bf46 100644 --- a/core/modules/config_translation/config_translation.contextual_links.yml +++ b/core/modules/config_translation/config_translation.contextual_links.yml @@ -1,4 +1,4 @@ config_translation.contextual_links: title: 'Translate @type_name' - derivative: 'Drupal\config_translation\Plugin\Derivative\ConfigTranslationContextualLinks' + deriver: 'Drupal\config_translation\Plugin\Derivative\ConfigTranslationContextualLinks' weight: 100 diff --git a/core/modules/config_translation/config_translation.local_tasks.yml b/core/modules/config_translation/config_translation.local_tasks.yml index 304d55700562f2a1732477b575ab157e285cbf85..513eb58e599eeca63d69517f6417634eee307568 100644 --- a/core/modules/config_translation/config_translation.local_tasks.yml +++ b/core/modules/config_translation/config_translation.local_tasks.yml @@ -1,4 +1,4 @@ config_translation.local_tasks: title: 'Translate @type_name' - derivative: 'Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks' + deriver: 'Drupal\config_translation\Plugin\Derivative\ConfigTranslationLocalTasks' weight: 100 diff --git a/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationContextualLinks.php b/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationContextualLinks.php index f705d4e8ba5a8302ea094e9cb9a0efe08e59fcf6..5050b0d507c19408472ace11d2c29907d0bb0053 100644 --- a/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationContextualLinks.php +++ b/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationContextualLinks.php @@ -8,15 +8,15 @@ namespace Drupal\config_translation\Plugin\Derivative; use Drupal\Component\Utility\Unicode; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\config_translation\ConfigMapperManagerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides dynamic contextual links for configuration translation. */ -class ConfigTranslationContextualLinks extends DerivativeBase implements ContainerDerivativeInterface { +class ConfigTranslationContextualLinks extends DeriverBase implements ContainerDeriverInterface { /** * The mapper plugin discovery service. diff --git a/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationLocalTasks.php b/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationLocalTasks.php index 53077d65f874f9f738922353b1055c046d079ca9..c36f72d5d3fc78795261ed0341018cb8ed7cc1a9 100644 --- a/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationLocalTasks.php +++ b/core/modules/config_translation/src/Plugin/Derivative/ConfigTranslationLocalTasks.php @@ -8,14 +8,14 @@ namespace Drupal\config_translation\Plugin\Derivative; use Drupal\config_translation\ConfigMapperManagerInterface; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides dynamic local tasks for config translation. */ -class ConfigTranslationLocalTasks extends DerivativeBase implements ContainerDerivativeInterface { +class ConfigTranslationLocalTasks extends DeriverBase implements ContainerDeriverInterface { /** * The mapper plugin discovery service. diff --git a/core/modules/content_translation/content_translation.contextual_links.yml b/core/modules/content_translation/content_translation.contextual_links.yml index 2d2818a9b9e8aa7e42ed363bd6ae3e594dd2968c..67aa2eb6d8a145845f69537a280beb67dc258381 100644 --- a/core/modules/content_translation/content_translation.contextual_links.yml +++ b/core/modules/content_translation/content_translation.contextual_links.yml @@ -1,3 +1,3 @@ content_translation.contextual_links: - derivative: 'Drupal\content_translation\Plugin\Derivative\ContentTranslationContextualLinks' + deriver: 'Drupal\content_translation\Plugin\Derivative\ContentTranslationContextualLinks' weight: 2 diff --git a/core/modules/content_translation/content_translation.local_tasks.yml b/core/modules/content_translation/content_translation.local_tasks.yml index 151c5845b205a0aec907a218353806bae4ef67f5..119d0d9ca958d67a5567ec216dee25a10f7bf09b 100644 --- a/core/modules/content_translation/content_translation.local_tasks.yml +++ b/core/modules/content_translation/content_translation.local_tasks.yml @@ -1,3 +1,3 @@ content_translation.local_tasks: - derivative: 'Drupal\content_translation\Plugin\Derivative\ContentTranslationLocalTasks' + deriver: 'Drupal\content_translation\Plugin\Derivative\ContentTranslationLocalTasks' weight: 100 diff --git a/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationContextualLinks.php b/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationContextualLinks.php index f231aa3c35e4122604e844eee7cf9de335a5d1da..b1f424fc1378e9abc41769068bc2b7bdf529b72d 100644 --- a/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationContextualLinks.php +++ b/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationContextualLinks.php @@ -7,8 +7,8 @@ namespace Drupal\content_translation\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Routing\RouteProviderInterface; use Drupal\content_translation\ContentTranslationManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -18,7 +18,7 @@ * * @see \Drupal\content_translation\Plugin\Menu\ContextualLink\ContentTranslationContextualLinks */ -class ContentTranslationContextualLinks extends DerivativeBase implements ContainerDerivativeInterface { +class ContentTranslationContextualLinks extends DeriverBase implements ContainerDeriverInterface { /** * The content translation manager. diff --git a/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationLocalTasks.php b/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationLocalTasks.php index 3fcfefecee3b2dc45b090bb3ee080ec7614236a0..8b060f2cb9fae828d37d7d8785338f654db96abb 100644 --- a/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationLocalTasks.php +++ b/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationLocalTasks.php @@ -8,14 +8,14 @@ namespace Drupal\content_translation\Plugin\Derivative; use Drupal\content_translation\ContentTranslationManagerInterface; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides dynamic local tasks for content translation. */ -class ContentTranslationLocalTasks extends DerivativeBase implements ContainerDerivativeInterface { +class ContentTranslationLocalTasks extends DeriverBase implements ContainerDeriverInterface { /** * The base plugin ID diff --git a/core/modules/entity_reference/src/Plugin/Derivative/SelectionBase.php b/core/modules/entity_reference/src/Plugin/Derivative/SelectionBase.php index 79a83276160f751dbede62e5bd91139f61fa19ff..9f7dc759a0ed28becef65b34894b7b0a24b6edb8 100644 --- a/core/modules/entity_reference/src/Plugin/Derivative/SelectionBase.php +++ b/core/modules/entity_reference/src/Plugin/Derivative/SelectionBase.php @@ -7,12 +7,12 @@ namespace Drupal\entity_reference\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; /** * Base class for selection plugins provided by Entity Reference. */ -class SelectionBase extends DerivativeBase { +class SelectionBase extends DeriverBase { /** * {@inheritdoc} */ diff --git a/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php index ae4f5fcd85cf3c8bfaf6c2f887b299405e6e3ea2..be55673b534c7605ccc782a25a92029092babafa 100644 --- a/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php +++ b/core/modules/entity_reference/src/Plugin/entity_reference/selection/SelectionBase.php @@ -22,7 +22,7 @@ * label = @Translation("Default"), * group = "default", * weight = 0, - * derivative = "Drupal\entity_reference\Plugin\Derivative\SelectionBase" + * deriver = "Drupal\entity_reference\Plugin\Derivative\SelectionBase" * ) */ class SelectionBase implements SelectionInterface { diff --git a/core/modules/field_ui/field_ui.local_tasks.yml b/core/modules/field_ui/field_ui.local_tasks.yml index d724933f399568ea41cc131ae9d11154f7d9ad31..5f00837802cc93b4b5c13a74bb53a2e3c9ca8984 100644 --- a/core/modules/field_ui/field_ui.local_tasks.yml +++ b/core/modules/field_ui/field_ui.local_tasks.yml @@ -4,4 +4,4 @@ field_ui.list: base_route: field_ui.list field_ui.fields: class: \Drupal\Core\Menu\LocalTaskDefault - derivative: \Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask + deriver: \Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask diff --git a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php index 37e546d6a3df624989923cab40676c6ba1b22967..1238afd72d7a3c3d09e4922a2f9ff5d8282f3609 100644 --- a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php +++ b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php @@ -8,8 +8,8 @@ namespace Drupal\field_ui\Plugin\Derivative; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Routing\RouteProviderInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; @@ -18,7 +18,7 @@ /** * Provides local task definitions for all entity bundles. */ -class FieldUiLocalTask extends DerivativeBase implements ContainerDerivativeInterface { +class FieldUiLocalTask extends DeriverBase implements ContainerDeriverInterface { use StringTranslationTrait; /** diff --git a/core/modules/language/src/Plugin/Block/LanguageBlock.php b/core/modules/language/src/Plugin/Block/LanguageBlock.php index 42d5bf3a339457ed4d1fce810f32943ad40045ad..42c8c8d9c3915f7b81727c32aa68427055401b2d 100644 --- a/core/modules/language/src/Plugin/Block/LanguageBlock.php +++ b/core/modules/language/src/Plugin/Block/LanguageBlock.php @@ -20,7 +20,7 @@ * id = "language_block", * admin_label = @Translation("Language switcher"), * category = @Translation("System"), - * derivative = "Drupal\language\Plugin\Derivative\LanguageBlock" + * deriver = "Drupal\language\Plugin\Derivative\LanguageBlock" * ) */ class LanguageBlock extends BlockBase implements ContainerFactoryPluginInterface { diff --git a/core/modules/language/src/Plugin/Derivative/LanguageBlock.php b/core/modules/language/src/Plugin/Derivative/LanguageBlock.php index b673d6655a0a797539dea7e783cffe8bb029d625..3c54c257b699fda29d59451babf172ae0b42c1c3 100644 --- a/core/modules/language/src/Plugin/Derivative/LanguageBlock.php +++ b/core/modules/language/src/Plugin/Derivative/LanguageBlock.php @@ -7,13 +7,13 @@ namespace Drupal\language\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\language\ConfigurableLanguageManagerInterface; /** * Provides language switcher block plugin definitions for all languages. */ -class LanguageBlock extends DerivativeBase { +class LanguageBlock extends DeriverBase { /** * {@inheritdoc} diff --git a/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php b/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php index 64816ec9a451df10aab8b22689c1e7a759baaa4f..8f4a57313435bf2c4496af2dc98d9bd311835bf1 100644 --- a/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php +++ b/core/modules/migrate/src/Plugin/Derivative/MigrateEntity.php @@ -7,10 +7,10 @@ namespace Drupal\migrate\Plugin\Derivative; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -class MigrateEntity implements ContainerDerivativeInterface { +class MigrateEntity implements ContainerDeriverInterface { /** * List of derivative definitions. diff --git a/core/modules/migrate/src/Plugin/Derivative/MigrateEntityRevision.php b/core/modules/migrate/src/Plugin/Derivative/MigrateEntityRevision.php index 922bedd873dc3de5a03687da4d7703ade0501ff7..5c9ae197245557cbc816b91e2f7cf83216169334 100644 --- a/core/modules/migrate/src/Plugin/Derivative/MigrateEntityRevision.php +++ b/core/modules/migrate/src/Plugin/Derivative/MigrateEntityRevision.php @@ -7,10 +7,10 @@ namespace Drupal\migrate\Plugin\Derivative; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -class MigrateEntityRevision implements ContainerDerivativeInterface { +class MigrateEntityRevision implements ContainerDeriverInterface { /** * List of derivative definitions. diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php index e29a30955bd39d32fc47df7ff7bfd09d49947372..8d69f80fbf45b7e15d0ad2c79652059da75982d6 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php @@ -16,7 +16,7 @@ /** * @MigrateDestination( * id = "entity", - * derivative = "Drupal\migrate\Plugin\Derivative\MigrateEntity" + * deriver = "Drupal\migrate\Plugin\Derivative\MigrateEntity" * ) */ abstract class Entity extends DestinationBase implements ContainerFactoryPluginInterface { diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php index 353f98c9c49d5ae47c46257fe0c5c307854ddf4e..8aaefef86ef53567f933123b73e2b692b6a62799 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php @@ -14,7 +14,7 @@ /** * @MigrateDestination( * id = "entity_revision", - * derivative = "Drupal\migrate\Plugin\Derivative\MigrateEntityRevision" + * deriver = "Drupal\migrate\Plugin\Derivative\MigrateEntityRevision" * ) */ class EntityRevision extends EntityContentBase { diff --git a/core/modules/rest/src/Plugin/Derivative/EntityDerivative.php b/core/modules/rest/src/Plugin/Derivative/EntityDerivative.php index fc62ede4f7acab670f026ba55488de47478814b7..5b17bc68e44db13bb8ac599a1af907000e4c8c53 100644 --- a/core/modules/rest/src/Plugin/Derivative/EntityDerivative.php +++ b/core/modules/rest/src/Plugin/Derivative/EntityDerivative.php @@ -8,7 +8,7 @@ namespace Drupal\rest\Plugin\Derivative; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Routing\RouteBuilder; use Drupal\Core\Routing\RouteBuilderInterface; use Drupal\Core\Routing\RouteProviderInterface; @@ -18,7 +18,7 @@ /** * Provides a resource plugin definition for every entity type. */ -class EntityDerivative implements ContainerDerivativeInterface { +class EntityDerivative implements ContainerDeriverInterface { /** * List of derivative definitions. diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php index 5625a8449e9212350f94ea29aa544be4e9f4f8a8..40f7fe685f974decf4c0f5469be74f370cdd916b 100644 --- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php +++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php @@ -22,7 +22,7 @@ * id = "entity", * label = @Translation("Entity"), * serialization_class = "Drupal\Core\Entity\Entity", - * derivative = "Drupal\rest\Plugin\Derivative\EntityDerivative", + * deriver = "Drupal\rest\Plugin\Derivative\EntityDerivative", * uri_paths = { * "canonical" = "/entity/{entity_type}/{entity}", * "http://drupal.org/link-relations/create" = "/entity/{entity_type}" diff --git a/core/modules/search/search.local_tasks.yml b/core/modules/search/search.local_tasks.yml index ac332d72f8e583f353be5b8e28daa36f9e4e4c68..882f95fe3cf65e86faff890dcafd0daefd8bf6bb 100644 --- a/core/modules/search/search.local_tasks.yml +++ b/core/modules/search/search.local_tasks.yml @@ -1,3 +1,3 @@ search.plugins: class: \Drupal\Core\Menu\LocalTaskDefault - derivative: \Drupal\search\Plugin\Derivative\SearchLocalTask + deriver: \Drupal\search\Plugin\Derivative\SearchLocalTask diff --git a/core/modules/search/src/Plugin/Derivative/SearchLocalTask.php b/core/modules/search/src/Plugin/Derivative/SearchLocalTask.php index 543c19060ab5f98a4704d4bca416b1d7f812c735..f9e07a008d5c091dd55b7d9d6ce6287d2b6cae17 100644 --- a/core/modules/search/src/Plugin/Derivative/SearchLocalTask.php +++ b/core/modules/search/src/Plugin/Derivative/SearchLocalTask.php @@ -7,15 +7,15 @@ namespace Drupal\search\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\search\SearchPageRepositoryInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides local tasks for each search page. */ -class SearchLocalTask extends DerivativeBase implements ContainerDerivativeInterface { +class SearchLocalTask extends DeriverBase implements ContainerDeriverInterface { /** * The search page repository. diff --git a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php index a698e1f9c496827fa28019f30f64163ac55ee86c..538147145e619871bd3efabc99db88f348904a52 100644 --- a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php @@ -21,7 +21,7 @@ * id = "system_menu_block", * admin_label = @Translation("Menu"), * category = @Translation("Menus"), - * derivative = "Drupal\system\Plugin\Derivative\SystemMenuBlock" + * deriver = "Drupal\system\Plugin\Derivative\SystemMenuBlock" * ) */ class SystemMenuBlock extends BlockBase implements ContainerFactoryPluginInterface { diff --git a/core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php b/core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php index 9b06eb3ecdfec4bc76a190eb33f3abe923a5cc1c..611ef2aff427c732b8f6131d474259f116c3214b 100644 --- a/core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php +++ b/core/modules/system/src/Plugin/Derivative/SystemMenuBlock.php @@ -7,9 +7,9 @@ namespace Drupal\system\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -17,7 +17,7 @@ * * @see \Drupal\system\Plugin\Block\SystemMenuBlock */ -class SystemMenuBlock extends DerivativeBase implements ContainerDerivativeInterface { +class SystemMenuBlock extends DeriverBase implements ContainerDeriverInterface { /** * The menu storage. diff --git a/core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php b/core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php index 0fa1ebc7e6dce853571f98c3aafcdf7eedc2995a..9c9de198eca2de205b43945e4ae4f189cac9bd0b 100644 --- a/core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php +++ b/core/modules/system/src/Plugin/Derivative/ThemeLocalTask.php @@ -7,15 +7,15 @@ namespace Drupal\system\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Extension\ThemeHandlerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides dynamic tabs based on active themes. */ -class ThemeLocalTask extends DerivativeBase implements ContainerDerivativeInterface { +class ThemeLocalTask extends DeriverBase implements ContainerDeriverInterface { /** * The theme handler. diff --git a/core/modules/system/system.local_tasks.yml b/core/modules/system/system.local_tasks.yml index ebc1d0fe1a4f48fed98709ee79146822995468ff..02fe18b013934446c46ff4bc87f385b377520ba6 100644 --- a/core/modules/system/system.local_tasks.yml +++ b/core/modules/system/system.local_tasks.yml @@ -32,7 +32,7 @@ system.theme_settings_theme: route_name: system.theme_settings_theme title: 'Theme name' parent_id: system.theme_settings - derivative: Drupal\system\Plugin\Derivative\ThemeLocalTask + deriver: Drupal\system\Plugin\Derivative\ThemeLocalTask system.modules_list: route_name: system.modules_list diff --git a/core/modules/system/tests/modules/entity_test/entity_test.local_tasks.yml b/core/modules/system/tests/modules/entity_test/entity_test.local_tasks.yml index a411359c5474f4b5f38edc9b839f5bc490d883c9..1acde6ae570ba883a6ab8aca98c2f632fb077290 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.local_tasks.yml +++ b/core/modules/system/tests/modules/entity_test/entity_test.local_tasks.yml @@ -1,2 +1,2 @@ entity_test.local_tasks: - derivative: 'Drupal\entity_test\Plugin\Derivative\EntityTestLocalTasks' + deriver: 'Drupal\entity_test\Plugin\Derivative\EntityTestLocalTasks' diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php index 8188ea41376ce1e2283485e7c31499a28e234963..9745ba22cbbd5102ba179cf9586d56fa2a692638 100644 --- a/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Derivative/EntityTestLocalTasks.php @@ -7,12 +7,12 @@ namespace Drupal\entity_test\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; /** * Defines the local tasks for all the entity_test entities. */ -class EntityTestLocalTasks extends DerivativeBase { +class EntityTestLocalTasks extends DeriverBase { /** * {@inheritdoc} diff --git a/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml b/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml index f4faf95ee04e0bf5a1ee179beb97578f897562c6..c8cd284eecb70bcf58c78dfa3f434ceda7b071c8 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml +++ b/core/modules/system/tests/modules/menu_test/menu_test.local_tasks.yml @@ -29,7 +29,7 @@ menu_test.local_task_test_tasks_settings_derived: route_name: menu_test.local_task_test_tasks_settings_derived title: derived parent_id: menu_test.local_task_test_tasks_settings - derivative: Drupal\menu_test\Plugin\Derivative\LocalTaskTest + deriver: Drupal\menu_test\Plugin\Derivative\LocalTaskTest weight: 50 menu_test.local_task_test.placeholder_sub1: route_name: menu_test.local_task_test_placeholder_sub1 diff --git a/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php b/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php index 29314ef71c4cfaec2b4d3742a8542419faa7568f..a345458a0bd0efc59cdfbeeb612db572de33c612 100644 --- a/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php +++ b/core/modules/system/tests/modules/menu_test/src/Plugin/Derivative/LocalTaskTest.php @@ -6,9 +6,9 @@ namespace Drupal\menu_test\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; -class LocalTaskTest extends DerivativeBase { +class LocalTaskTest extends DeriverBase { /** * {@inheritdoc} diff --git a/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php b/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php index 6de31cd8655ed29fae04c20e31434271e2b4a4bf..ca5847fcd7f27bff2ad91dccdfe409da09b8202f 100644 --- a/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php +++ b/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php @@ -52,7 +52,7 @@ public function __construct() { // base plugin, are available to the system. $this->discovery->setDefinition('menu', array( 'class' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockMenuBlock', - 'derivative' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockMenuBlockDeriver', + 'deriver' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockMenuBlockDeriver', )); // A plugin defining itself as a derivative. $this->discovery->setDefinition('menu:foo', array( @@ -69,7 +69,7 @@ public function __construct() { $this->discovery->setDefinition('layout', array( 'label' => t('Layout'), 'class' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockLayoutBlock', - 'derivative' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockLayoutBlockDeriver', + 'deriver' => 'Drupal\plugin_test\Plugin\plugin_test\mock_block\MockLayoutBlockDeriver', )); // A block plugin that requires context to function. This block requires a diff --git a/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php b/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php index 1a33551c5efdfbf2d34e3828de97c948749ba516..267a397586ab6375858e118b8cd88a5eed24a083 100644 --- a/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php +++ b/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php @@ -7,17 +7,17 @@ namespace Drupal\plugin_test\Plugin\plugin_test\mock_block; -use Drupal\Component\Plugin\Derivative\DerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverInterface; /** - * Mock implementation of DerivativeInterface for the mock layout block plugin. + * Mock implementation of DeriverInterface for the mock layout block plugin. * * @see \Drupal\plugin_test\Plugin\MockBlockManager */ -class MockLayoutBlockDeriver implements DerivativeInterface { +class MockLayoutBlockDeriver implements DeriverInterface { /** - * Implements Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinition(). + * {@inheritdoc} */ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) { $derivatives = $this->getDerivativeDefinitions($base_plugin_definition); @@ -27,14 +27,14 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) } /** - * Implements Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions(). + * {@inheritdoc} */ public function getDerivativeDefinitions($base_plugin_definition) { // This isn't strictly necessary, but it helps reduce clutter in // DerivativePluginTest::testDerivativeDecorator()'s $expected variable. // Since derivative definitions don't need further deriving, we remove this // key from the returned definitions. - unset($base_plugin_definition['derivative']); + unset($base_plugin_definition['deriver']); $derivatives = array( // Adding a NULL key signifies that the base plugin may also be used in diff --git a/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockMenuBlockDeriver.php b/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockMenuBlockDeriver.php index aaa1d1c047e5f970e60f43e904554c38d8afedf7..9048e0059209c1ef60b014be6f3ae30a2bd7db59 100644 --- a/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockMenuBlockDeriver.php +++ b/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockMenuBlockDeriver.php @@ -7,17 +7,17 @@ namespace Drupal\plugin_test\Plugin\plugin_test\mock_block; -use Drupal\Component\Plugin\Derivative\DerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverInterface; /** - * Mock implementation of DerivativeInterface for the mock menu block plugin. + * Mock implementation of DeriverInterface for the mock menu block plugin. * * @see \Drupal\plugin_test\Plugin\MockBlockManager */ -class MockMenuBlockDeriver implements DerivativeInterface { +class MockMenuBlockDeriver implements DeriverInterface { /** - * Implements Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinition(). + * {@inheritdoc} */ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) { $derivatives = $this->getDerivativeDefinitions($base_plugin_definition); @@ -27,14 +27,14 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) } /** - * Implements Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions(). + * {@inheritdoc} */ public function getDerivativeDefinitions($base_plugin_definition) { // This isn't strictly necessary, but it helps reduce clutter in // DerivativePluginTest::testDerivativeDecorator()'s $expected variable. // Since derivative definitions don't need further deriving, we remove this // key from the returned definitions. - unset($base_plugin_definition['derivative']); + unset($base_plugin_definition['deriver']); // Here, we create some mock menu block definitions for menus that might // exist in a typical Drupal site. In a real implementation, we would query diff --git a/core/modules/views/src/Plugin/Block/ViewsBlock.php b/core/modules/views/src/Plugin/Block/ViewsBlock.php index 26489195b9d58e9afa9a47f91a34658a1d0242e6..a80aa97b20bcc6a7da77bcb23e68f0cd918ff7d7 100644 --- a/core/modules/views/src/Plugin/Block/ViewsBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsBlock.php @@ -17,7 +17,7 @@ * @Block( * id = "views_block", * admin_label = @Translation("Views Block"), - * derivative = "Drupal\views\Plugin\Derivative\ViewsBlock" + * deriver = "Drupal\views\Plugin\Derivative\ViewsBlock" * ) */ class ViewsBlock extends ViewsBlockBase { diff --git a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php index 4796f692e682514a5ac0308a7047f0e1a3c08b36..f38d48521fc7dbb84897ae968c62cb0d92ae7d11 100644 --- a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php @@ -13,7 +13,7 @@ * @Block( * id = "views_exposed_filter_block", * admin_label = @Translation("Views Exposed Filter Block"), - * derivative = "Drupal\views\Plugin\Derivative\ViewsExposedFilterBlock" + * deriver = "Drupal\views\Plugin\Derivative\ViewsExposedFilterBlock" * ) */ class ViewsExposedFilterBlock extends ViewsBlockBase { diff --git a/core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php b/core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php index 211d8be5e13dff629fa20c620296f1d018a17d90..f7610f28462c27caf507ee89783f477a72a86e1d 100644 --- a/core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php +++ b/core/modules/views/src/Plugin/Derivative/DefaultWizardDeriver.php @@ -7,7 +7,7 @@ namespace Drupal\views\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\views\Views; /** @@ -15,7 +15,7 @@ * * The derivatives store all base table plugin information. */ -class DefaultWizardDeriver extends DerivativeBase { +class DefaultWizardDeriver extends DeriverBase { /** * {@inheritdoc} */ diff --git a/core/modules/views/src/Plugin/Derivative/ViewsBlock.php b/core/modules/views/src/Plugin/Derivative/ViewsBlock.php index be44dca3e27ae9aa8456d2715ec3fa9f8704da90..cec98956a681b27dfddc2023dd0462e0963937e1 100644 --- a/core/modules/views/src/Plugin/Derivative/ViewsBlock.php +++ b/core/modules/views/src/Plugin/Derivative/ViewsBlock.php @@ -8,7 +8,7 @@ namespace Drupal\views\Plugin\Derivative; use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -16,7 +16,7 @@ * * @see \Drupal\views\Plugin\block\block\ViewsBlock */ -class ViewsBlock implements ContainerDerivativeInterface { +class ViewsBlock implements ContainerDeriverInterface { /** * List of derivative definitions. @@ -63,7 +63,7 @@ public function __construct($base_plugin_id, EntityStorageInterface $view_storag } /** - * Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinition(). + * {@inheritdoc} */ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) { if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) { @@ -74,7 +74,7 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) } /** - * Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions(). + * {@inheritdoc} */ public function getDerivativeDefinitions($base_plugin_definition) { // Check all Views for block displays. diff --git a/core/modules/views/src/Plugin/Derivative/ViewsEntityArgumentValidator.php b/core/modules/views/src/Plugin/Derivative/ViewsEntityArgumentValidator.php index 7c83546f7bdb3e2bf4b5d272e30e2ce6992d635e..ee6a582c86ecbdcf92d7336fa447b749dc5c77bc 100644 --- a/core/modules/views/src/Plugin/Derivative/ViewsEntityArgumentValidator.php +++ b/core/modules/views/src/Plugin/Derivative/ViewsEntityArgumentValidator.php @@ -7,9 +7,9 @@ namespace Drupal\views\Plugin\Derivative; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Entity\EntityManagerInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\TranslationInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -21,7 +21,7 @@ * * @see \Drupal\views\Plugin\views\argument_validator\Entity */ -class ViewsEntityArgumentValidator extends DerivativeBase implements ContainerDerivativeInterface { +class ViewsEntityArgumentValidator extends DeriverBase implements ContainerDeriverInterface { use StringTranslationTrait; /** diff --git a/core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php b/core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php index 4376fc3e7923801c48910fb36e655233a2bbb4da..ea064c0ec8595430416128bb9d2775f83680e93f 100644 --- a/core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php +++ b/core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php @@ -8,7 +8,7 @@ namespace Drupal\views\Plugin\Derivative; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\views\ViewsData; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -19,7 +19,7 @@ * * @see \Drupal\views\Plugin\views\row\EntityRow */ -class ViewsEntityRow implements ContainerDerivativeInterface { +class ViewsEntityRow implements ContainerDeriverInterface { /** * Stores all entity row plugin information. diff --git a/core/modules/views/src/Plugin/Derivative/ViewsExposedFilterBlock.php b/core/modules/views/src/Plugin/Derivative/ViewsExposedFilterBlock.php index 2dd5f69ae04721a786da8b02b61cd6b45a50ee14..0ef5fcd9eebc26fe688a3584fa7fec21b5f7580b 100644 --- a/core/modules/views/src/Plugin/Derivative/ViewsExposedFilterBlock.php +++ b/core/modules/views/src/Plugin/Derivative/ViewsExposedFilterBlock.php @@ -7,7 +7,7 @@ namespace Drupal\views\Plugin\Derivative; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Entity\EntityStorageInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -16,7 +16,7 @@ * * @see \Drupal\views\Plugin\block\block\ViewsExposedFilterBlock */ -class ViewsExposedFilterBlock implements ContainerDerivativeInterface { +class ViewsExposedFilterBlock implements ContainerDeriverInterface { /** * List of derivative definitions. @@ -63,7 +63,7 @@ public static function create(ContainerInterface $container, $base_plugin_id) { } /** - * Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinition(). + * {@inheritdoc} */ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) { if (!empty($this->derivatives) && !empty($this->derivatives[$derivative_id])) { @@ -74,7 +74,7 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition) } /** - * Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions(). + * {@inheritdoc} */ public function getDerivativeDefinitions($base_plugin_definition) { // Check all Views for displays with an exposed filter block. diff --git a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php index fb05a494690c363bc5a3cf2b374f13344df4e600..f1ae20dda6bc977b0fab860c7160bb5b460ef578 100644 --- a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php +++ b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php @@ -8,8 +8,8 @@ namespace Drupal\views\Plugin\Derivative; use Drupal\Core\State\StateInterface; -use Drupal\Component\Plugin\Derivative\DerivativeBase; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverBase; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Routing\RouteProviderInterface; use Drupal\views\Views; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -17,7 +17,7 @@ /** * Provides local task definitions for all views configured as local tasks. */ -class ViewsLocalTask extends DerivativeBase implements ContainerDerivativeInterface { +class ViewsLocalTask extends DeriverBase implements ContainerDeriverInterface { /** * The route provider. diff --git a/core/modules/views/src/Plugin/views/argument_validator/Entity.php b/core/modules/views/src/Plugin/views/argument_validator/Entity.php index cfe5f179930a6fafe75f0c030a2a788b58c136a5..a807cbc467f09f30fe8e7efebbbf02307879124c 100644 --- a/core/modules/views/src/Plugin/views/argument_validator/Entity.php +++ b/core/modules/views/src/Plugin/views/argument_validator/Entity.php @@ -17,7 +17,7 @@ * * @ViewsArgumentValidator( * id = "entity", - * derivative = "Drupal\views\Plugin\Derivative\ViewsEntityArgumentValidator" + * deriver = "Drupal\views\Plugin\Derivative\ViewsEntityArgumentValidator" * ) * * @see \Drupal\views\Plugin\Derivative\ViewsEntityArgumentValidator diff --git a/core/modules/views/src/Plugin/views/row/EntityRow.php b/core/modules/views/src/Plugin/views/row/EntityRow.php index b9c582777cf025b8709ae78e173caaeee3ee1864..c46d354e3d58e74b559c2558db37d5b02a695963 100644 --- a/core/modules/views/src/Plugin/views/row/EntityRow.php +++ b/core/modules/views/src/Plugin/views/row/EntityRow.php @@ -20,7 +20,7 @@ * * @ViewsRow( * id = "entity", - * derivative = "Drupal\views\Plugin\Derivative\ViewsEntityRow" + * deriver = "Drupal\views\Plugin\Derivative\ViewsEntityRow" * ) */ class EntityRow extends RowPluginBase { diff --git a/core/modules/views/src/Plugin/views/wizard/Standard.php b/core/modules/views/src/Plugin/views/wizard/Standard.php index 6793a779edd62852cddafd315102f7d7f7396f0e..6683adced1ed0a02046f2367a87529c48d4b1bfc 100644 --- a/core/modules/views/src/Plugin/views/wizard/Standard.php +++ b/core/modules/views/src/Plugin/views/wizard/Standard.php @@ -14,7 +14,7 @@ * * @ViewsWizard( * id = "standard", - * derivative = "Drupal\views\Plugin\Derivative\DefaultWizardDeriver", + * deriver = "Drupal\views\Plugin\Derivative\DefaultWizardDeriver", * title = @Translation("Default wizard") * ) */ diff --git a/core/modules/views/tests/src/Plugin/Derivative/ViewsLocalTaskTest.php b/core/modules/views/tests/src/Plugin/Derivative/ViewsLocalTaskTest.php index 359ae7c36c8995e0588405f10a9d115dfc218fe8..f58aaaef9d641e6cd8472f6cb65f533df98ba3ae 100644 --- a/core/modules/views/tests/src/Plugin/Derivative/ViewsLocalTaskTest.php +++ b/core/modules/views/tests/src/Plugin/Derivative/ViewsLocalTaskTest.php @@ -35,7 +35,7 @@ class ViewsLocalTaskTest extends UnitTestCase { protected $baseDefinition = array( 'class' => '\Drupal\views\Plugin\Menu\LocalTask\ViewsLocalTask', - 'derivative' => '\Drupal\views\Plugin\Derivative\ViewsLocalTask' + 'deriver' => '\Drupal\views\Plugin\Derivative\ViewsLocalTask' ); /** diff --git a/core/modules/views/views.local_tasks.yml b/core/modules/views/views.local_tasks.yml index f050e642dc16cc4c47d35b8fb64bebaa05bcb003..e9debbacb5401512db795565f7bee385abe34823 100644 --- a/core/modules/views/views.local_tasks.yml +++ b/core/modules/views/views.local_tasks.yml @@ -1,3 +1,3 @@ views_view: class: Drupal\Core\Menu\LocalTaskDefault - derivative: \Drupal\views\Plugin\Derivative\ViewsLocalTask + deriver: \Drupal\views\Plugin\Derivative\ViewsLocalTask diff --git a/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php b/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php index 431499b24837595e395d8e6076a4932f429a8c6c..2b4ccd8636c1bd5665d38d506b1649d4ace7f348 100644 --- a/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php +++ b/core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php @@ -58,28 +58,29 @@ public function providerTestGetPluginId() { } /** - * Tests the getBasePluginId method. + * Tests the getBaseId method. * - * @dataProvider providerTestGetBasePluginId + * @dataProvider providerTestGetBaseId * - * @see \Drupal\Component\Plugin\PluginBase::getBasePluginId() + * @see \Drupal\Component\Plugin\PluginBase::getBaseId() */ - public function testGetBasePluginId($plugin_id, $expected) { + public function testGetBaseId($plugin_id, $expected) { + /** @var \Drupal\Component\Plugin\PluginBase|\PHPUnit_Framework_MockObject_MockObject $plugin_base */ $plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', array( array(), $plugin_id, array(), )); - $this->assertEquals($expected, $plugin_base->getBasePluginId()); + $this->assertEquals($expected, $plugin_base->getBaseId()); } /** - * Returns test data for testGetBasePluginId(). + * Returns test data for testGetBaseId(). * * @return array */ - public function providerTestGetBasePluginId() { + public function providerTestGetBaseId() { return array( array('base_id', 'base_id'), array('base_id:derivative', 'base_id'), @@ -88,13 +89,14 @@ public function providerTestGetBasePluginId() { /** - * Tests the getBasePluginId method. + * Tests the getDerivativeId method. * * @dataProvider providerTestGetDerivativeId * - * @see \Drupal\Component\Plugin\PluginBase::getBasePluginId() + * @see \Drupal\Component\Plugin\PluginBase::getDerivativeId() */ public function testGetDerivativeId($plugin_id = NULL, $expected = NULL) { + /** @var \Drupal\Component\Plugin\PluginBase|\PHPUnit_Framework_MockObject_MockObject $plugin_base */ $plugin_base = $this->getMockForAbstractClass('Drupal\Component\Plugin\PluginBase', array( array(), $plugin_id, @@ -105,7 +107,7 @@ public function testGetDerivativeId($plugin_id = NULL, $expected = NULL) { } /** - * Returns test data for testGetBasePluginId(). + * Returns test data for testGetDerivativeId(). * * @return array */ diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php index 5a53a694569962585e65256ba707b83f6b80d006..20d32ca89b02e3b05ad86b29759c046ffd495f42 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecoratorTest.php @@ -46,11 +46,11 @@ public function testGetDerivativeFetcher() { $definitions = array(); $definitions['container_aware_discovery'] = array( 'id' => 'container_aware_discovery', - 'derivative' => '\Drupal\Tests\Core\Plugin\Discovery\TestContainerDerivativeDiscovery', + 'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestContainerDerivativeDiscovery', ); $definitions['non_container_aware_discovery'] = array( 'id' => 'non_container_aware_discovery', - 'derivative' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', + 'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', ); $discovery_main = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface'); diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php index c22c2018619f910c0881493083bb1f40095fe3d9..079b315d84ff3236ee808b436cfd76d0172788c6 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\Core\Plugin\Discovery; use Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator; -use Drupal\Component\Plugin\Exception\InvalidDerivativeClassException; +use Drupal\Component\Plugin\Exception\InvalidDeriverException; use Drupal\Tests\UnitTestCase; /** @@ -50,7 +50,7 @@ public function testGetDerivativeFetcher() { $definitions = array(); $definitions['non_container_aware_discovery'] = array( 'id' => 'non_container_aware_discovery', - 'derivative' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', + 'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', ); $this->discoveryMain->expects($this->any()) @@ -63,10 +63,10 @@ public function testGetDerivativeFetcher() { // Ensure that both test derivatives got added. $this->assertEquals(2, count($definitions)); $this->assertEquals('non_container_aware_discovery', $definitions['non_container_aware_discovery:test_discovery_0']['id']); - $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', $definitions['non_container_aware_discovery:test_discovery_0']['derivative']); + $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', $definitions['non_container_aware_discovery:test_discovery_0']['deriver']); $this->assertEquals('non_container_aware_discovery', $definitions['non_container_aware_discovery:test_discovery_1']['id']); - $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', $definitions['non_container_aware_discovery:test_discovery_1']['derivative']); + $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', $definitions['non_container_aware_discovery:test_discovery_1']['deriver']); } /** @@ -76,7 +76,7 @@ public function testGetDerivativeFetcherWithAnnotationObjects() { $definitions = array(); $definitions['non_container_aware_discovery'] = (object) array( 'id' => 'non_container_aware_discovery', - 'derivative' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject', + 'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject', ); $this->discoveryMain->expects($this->any()) @@ -90,26 +90,26 @@ public function testGetDerivativeFetcherWithAnnotationObjects() { $this->assertEquals(2, count($definitions)); $this->assertInstanceOf('\stdClass', $definitions['non_container_aware_discovery:test_discovery_0']); $this->assertEquals('non_container_aware_discovery', $definitions['non_container_aware_discovery:test_discovery_0']->id); - $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject', $definitions['non_container_aware_discovery:test_discovery_0']->derivative); + $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject', $definitions['non_container_aware_discovery:test_discovery_0']->deriver); $this->assertInstanceOf('\stdClass', $definitions['non_container_aware_discovery:test_discovery_1']); $this->assertEquals('non_container_aware_discovery', $definitions['non_container_aware_discovery:test_discovery_1']->id); - $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject', $definitions['non_container_aware_discovery:test_discovery_1']->derivative); + $this->assertEquals('\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscoveryWithObject', $definitions['non_container_aware_discovery:test_discovery_1']->deriver); } /** * Tests the getDerivativeFetcher method with an invalid class. * - * @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDerivativeFetcher().\ + * @see \Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator::getDeriver().\ * - * @expectedException \Drupal\Component\Plugin\Exception\InvalidDerivativeClassException + * @expectedException \Drupal\Component\Plugin\Exception\InvalidDeriverException */ public function testInvalidDerivativeFetcher() { $definitions = array(); // Do this with a class that doesn't implement the interface. $definitions['invalid_discovery'] = array( 'id' => 'invalid_discovery', - 'derivative' => '\Drupal\system\Tests\Plugin\DerivativeTest', + 'deriver' => '\Drupal\system\Tests\Plugin\DerivativeTest', ); $this->discoveryMain->expects($this->any()) ->method('getDefinitions') @@ -126,7 +126,7 @@ public function testExistingDerivative() { $definitions = array(); $definitions['non_container_aware_discovery'] = array( 'id' => 'non_container_aware_discovery', - 'derivative' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', + 'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', 'string' => 'string', 'empty_string' => 'not_empty', 'array' => array('one', 'two'), @@ -165,7 +165,7 @@ public function testExistingDerivative() { public function testSingleExistingDerivative() { $base_definition = array( 'id' => 'non_container_aware_discovery', - 'derivative' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', + 'deriver' => '\Drupal\Tests\Core\Plugin\Discovery\TestDerivativeDiscovery', 'string' => 'string', 'empty_string' => 'not_empty', 'array' => array('one', 'two'), diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestContainerDerivativeDiscovery.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestContainerDerivativeDiscovery.php index 88bebf2142dd6a576c96b1df68c4e344c2548786..46ca62c6d8b5dc1deb1da8683f1f45f4f0d8d808 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestContainerDerivativeDiscovery.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestContainerDerivativeDiscovery.php @@ -7,14 +7,14 @@ namespace Drupal\Tests\Core\Plugin\Discovery; -use Drupal\Core\Plugin\Discovery\ContainerDerivativeInterface; +use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * Defines container test derivative discovery. */ -class TestContainerDerivativeDiscovery extends TestDerivativeDiscovery implements ContainerDerivativeInterface { +class TestContainerDerivativeDiscovery extends TestDerivativeDiscovery implements ContainerDeriverInterface { /** * Constructs a TestContainerDerivativeDiscovery object. diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php index f1bf08315951998908d77b49753567c4ca81f997..633475af229afef9c134c2d495c86ed95f780a4e 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscovery.php @@ -7,12 +7,12 @@ namespace Drupal\Tests\Core\Plugin\Discovery; -use Drupal\Component\Plugin\Derivative\DerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverInterface; /** * Defines test derivative discovery. */ -class TestDerivativeDiscovery implements DerivativeInterface { +class TestDerivativeDiscovery implements DeriverInterface { /** * {@inheritdoc} diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php index 1e7e5bca81b95c876eaa14ed89561d8688e4e801..9cab937c95216b79479b402470e33dba3a95802f 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php @@ -7,12 +7,12 @@ namespace Drupal\Tests\Core\Plugin\Discovery; -use Drupal\Component\Plugin\Derivative\DerivativeInterface; +use Drupal\Component\Plugin\Derivative\DeriverInterface; /** * Defines test derivative discovery using an object.. */ -class TestDerivativeDiscoveryWithObject implements DerivativeInterface { +class TestDerivativeDiscoveryWithObject implements DeriverInterface { /** * {@inheritdoc}