src/AbstractContainerMediator.php
public function removeServiceListener(string $eventName, array $listener, $priority = 0): ContainerMediatorInterface
    {
        $this->checkEventName($eventName);
        if (!\array_key_exists($eventName, $this->serviceListeners)) {
            return $this;
        }
        $this->checkAllowedServiceListener($listener);
        if (\in_array($eventName, $this->loadedServices, \true)) {
            $this->removeListener($eventName, [$this->getServiceByName($listener[0]), $listener[1]], $priority);
        }
        /**
         * @var array      $priorities
         * @var int|string $atPriority
         * @var array      $listeners
         */
        if ('last' !== $priority) {
            $priorities = $this->serviceListeners[$eventName];
        } else {
            $priorities = \array_reverse($this->serviceListeners[$eventName], \true);
            $priority = 'first';
        }
        $isIntPriority = \is_int($priority);
        foreach ($priorities as $atPriority => $listeners) {
            if ($isIntPriority && $priority !== $atPriority) {
                continue;
            }
            $key = \array_search($listener, $listeners, \true);
            if (\false !== $key) {
                $this->bubbleUpUnsetServiceListener($eventName, $atPriority, $key);
                if ('first' === $priority) {
                    break;
                }
            }
        }
        return $this;
    }
public function removeServiceListener(string $eventName, array $listener, $priority = 0): ContainerMediatorInterface
    {
        $this->checkEventName($eventName);
        if (!\array_key_exists($eventName, $this->serviceListeners)) {
            return $this;
        }
        $this->checkAllowedServiceListener($listener);
        if (\in_array($eventName, $this->loadedServices, \true)) {
            $this->removeListener($eventName, [$this->getServiceByName($listener[0]), $listener[1]], $priority);
        }
        /**
         * @var array      $priorities
         * @var int|string $atPriority
         * @var array      $listeners
         */
        if ('last' !== $priority) {
            $priorities = $this->serviceListeners[$eventName];
        } else {
            $priorities = \array_reverse($this->serviceListeners[$eventName], \true);
            $priority = 'first';
        }
        $isIntPriority = \is_int($priority);
        foreach ($priorities as $atPriority => $listeners) {
            if ($isIntPriority && $priority !== $atPriority) {
                continue;
            }
            $key = \array_search($listener, $listeners, \true);
            if (\false !== $key) {
                $this->bubbleUpUnsetServiceListener($eventName, $atPriority, $key);
                if ('first' === $priority) {
                    break;
                }
            }
        }
        return $this;
    }
public function removeServiceListener ( string $ eventName , array $ listener , $ priority = 0 ) : ContainerMediatorInterface { $ this -> checkEventName ( $ eventName ) ; if ( ! \ array_key_exists ( $ eventName , $ this -> serviceListeners ) ) { return $ this ; } $ this -> checkAllowedServiceListener ( $ listener ) ; if ( \ in_array ( $ eventName , $ this -> loadedServices , \ true ) ) { $ this -> removeListener ( $ eventName , [ $ this -> getServiceByName ( $ listener [ 0 ] ) , $ listener [ 1 ] ] , $ priority ) ; } /**
         * @var array      $priorities
         * @var int|string $atPriority
         * @var array      $listeners
         */ if ( 'last' !== $ priority ) { $ priorities = $ this -> serviceListeners [ $ eventName ] ; } else { $ priorities = \ array_reverse ( $ this -> serviceListeners [ $ eventName ] , \ true ) ; $ priority = 'first' ; } $ isIntPriority = \ is_int ( $ priority ) ; foreach ( $ priorities as $ atPriority => $ listeners ) { if ( $ isIntPriority && $ priority !== $ atPriority ) { continue ; } $ key = \ array_search ( $ listener , $ listeners , \ true ) ; if ( \ false !== $ key ) { $ this -> bubbleUpUnsetServiceListener ( $ eventName , $ atPriority , $ key ) ; if ( 'first' === $ priority ) { break ; } } } return $ this ; }
Remove a service as an event listener.

@param string     $eventName Event name that listener is being removed from.
@param array      $listener  Service listener to be removed.
@param int|string $priority  Priority level for the to be removed listener.

@return ContainerMediatorInterface Fluent interface.
@throws \DomainException
@throws \InvalidArgumentException
Remove a service as an event listener .