public function removeEventSubscriber(AnEventSubscriberInterface $subscriber)
    {
        $handle = $subscriber->getHandle();
    
        if (isset($this->_subscribers[$handle])) {
            $subscriptions = $subscriber->getSubscriptions();
    
            foreach ($subscriptions as $subscription) {
                $this->removeEventListener($subscription, $subscriber);
            }
    
            unset($this->_subscribers[$handle]);
        }
    
        return $this;
    }