diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php index 60c7a6d..fda318f 100644 --- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php +++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php @@ -7,7 +7,6 @@ namespace Drupal\Core\Plugin; -use Drupal\Core\Plugin\PluginRemovalEvents; use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface; use Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait; use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator; @@ -239,12 +238,10 @@ protected function findDefinitions() { * {@inheritdoc} */ public function removePluginId($plugin_id, $permanent = TRUE, array $conditions = array()) { - /** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher */ - $event_dispatcher = \Drupal::service('event_dispatcher'); $event_name = $permanent ? PluginRemovalEvents::PERMANENTLY_UNAVAILABLE : PluginRemovalEvents::TEMPORARILY_UNAVAILABLE; // @todo Introduce a proper plugin type. $plugin_type = isset($this->subdir) ? strtolower(str_replace('/', '_', $this->subdir)) : get_class($this); - $event_dispatcher->dispatch($event_name, new PluginRemovalEvent($plugin_type, $plugin_id, $permanent, $conditions)); + $this->eventDispatcher->dispatch($event_name, new PluginRemovalEvent($plugin_type, $plugin_id, $permanent, $conditions)); } }