Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EventDispatcher.php

function EventDispatcher::removeSubscriber

Overrides EventDispatcherInterface::removeSubscriber

File

vendor/symfony/event-dispatcher/EventDispatcher.php, line 175

Class

EventDispatcher
The EventDispatcherInterface is the central point of Symfony's event listener system.

Namespace

Symfony\Component\EventDispatcher

Code

public function removeSubscriber(EventSubscriberInterface $subscriber) : void {
    foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
        if (\is_array($params) && \is_array($params[0])) {
            foreach ($params as $listener) {
                $this->removeListener($eventName, [
                    $subscriber,
                    $listener[0],
                ]);
            }
        }
        else {
            $this->removeListener($eventName, [
                $subscriber,
                \is_string($params) ? $params : $params[0],
            ]);
        }
    }
}
RSS feed
Powered by Drupal