public function EventDispatcher::removeSubscriber

Overrides EventDispatcherInterface::removeSubscriber

See also

EventDispatcherInterface::removeSubscriber

File

drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php, line 138

Class

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

Namespace

Symfony\Component\EventDispatcher

Code

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