diff --git a/core/modules/views/src/Plugin/Derivative/ViewsBlock.php b/core/modules/views/src/Plugin/Derivative/ViewsBlock.php index 3ba84e5..e3d3732 100644 --- a/core/modules/views/src/Plugin/Derivative/ViewsBlock.php +++ b/core/modules/views/src/Plugin/Derivative/ViewsBlock.php @@ -6,7 +6,6 @@ use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\StringTranslation\TranslatableMarkup; -use Drupal\views\Plugin\views\ArgumentContextProviderInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -115,7 +114,8 @@ public function getDerivativeDefinitions($base_plugin_definition) { // Look for arguments and expose them as context. foreach ($display->getHandlers('argument') as $argument_name => $argument) { - if ($argument instanceof ArgumentContextProviderInterface && $context_definition = $argument->getContextDefinition()) { + /** @var \Drupal\views\Plugin\views\argument\ArgumentPluginBase $argument */ + if ($context_definition = $argument->getContextDefinition()) { $this->derivatives[$delta]['context'][$argument_name] = $context_definition; } } diff --git a/core/modules/views/src/Plugin/views/ArgumentContextProviderInterface.php b/core/modules/views/src/Plugin/views/ArgumentContextProviderInterface.php deleted file mode 100644 index 977678d..0000000 --- a/core/modules/views/src/Plugin/views/ArgumentContextProviderInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -getPlugin('argument_validator') instanceof ArgumentContextProviderInterface) { - return $this->getPlugin('argument_validator')->getContextDefinition(); - } + return $this->getPlugin('argument_validator')->getContextDefinition(); } } diff --git a/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php b/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php index 109af50..c1d41d4 100644 --- a/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php @@ -104,6 +104,15 @@ public function validateArgument($arg) { return TRUE; } */ public function processSummaryArguments(&$args) { } + /** + * Returns a context definition for this argument. + * + * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface|null + * A context definition that represents the argument or NULL if that is + * not possible. + */ + public function getContextDefinition() { } + } /** 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 bec60ac..5a963ba 100644 --- a/core/modules/views/src/Plugin/views/argument_validator/Entity.php +++ b/core/modules/views/src/Plugin/views/argument_validator/Entity.php @@ -7,7 +7,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\views\Plugin\views\argument\ArgumentPluginBase; -use Drupal\views\Plugin\views\ArgumentContextProviderInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -20,7 +19,7 @@ * * @see \Drupal\views\Plugin\Derivative\ViewsEntityArgumentValidator */ -class Entity extends ArgumentValidatorPluginBase implements ArgumentContextProviderInterface { +class Entity extends ArgumentValidatorPluginBase { /** * The entity manager. diff --git a/core/modules/views/src/Plugin/views/argument_validator/NumericArgumentValidator.php b/core/modules/views/src/Plugin/views/argument_validator/NumericArgumentValidator.php index 90928c5..7368e06 100644 --- a/core/modules/views/src/Plugin/views/argument_validator/NumericArgumentValidator.php +++ b/core/modules/views/src/Plugin/views/argument_validator/NumericArgumentValidator.php @@ -3,7 +3,6 @@ namespace Drupal\views\Plugin\views\argument_validator; use Drupal\Core\Plugin\Context\ContextDefinition; -use Drupal\views\Plugin\views\ArgumentContextProviderInterface; /** * Validate whether an argument is numeric or not. @@ -15,7 +14,7 @@ * title = @Translation("Numeric") * ) */ -class NumericArgumentValidator extends ArgumentValidatorPluginBase implements ArgumentContextProviderInterface { +class NumericArgumentValidator extends ArgumentValidatorPluginBase { public function validateArgument($argument) { return is_numeric($argument);