public function removeSubscriber(SubscriberInterface $instance) {

		// check for object hash

		if(FALSE !== ($pos = array_search(spl_object_hash($instance), $this->registeredHashes))) {
		
			// remove instance from registry before re-inserting
			
			unset($this->registeredHashes[$pos]);

			foreach($instance::getEventsToSubscribe() as $eventName => $parameters) {
			
				$methodName	= array_shift($parameters);
				$callable = array($instance, $methodName);
			
				foreach($this->registry[$eventName] as $priority => $subscribers) {
						
					if (false !== ($pos = array_search($callable, $subscribers, TRUE))) {
						unset(
							$this->registry[$eventName][$priority][$pos],
							$this->sortedRegistry[$eventName]
						);
					}

				}
			}
		}
	}
public function removeSubscriber(SubscriberInterface $instance) {

		// check for object hash

		if(FALSE !== ($pos = array_search(spl_object_hash($instance), $this->registeredHashes))) {
		
			// remove instance from registry before re-inserting
			
			unset($this->registeredHashes[$pos]);

			foreach($instance::getEventsToSubscribe() as $eventName => $parameters) {
			
				$methodName	= array_shift($parameters);
				$callable = array($instance, $methodName);
			
				foreach($this->registry[$eventName] as $priority => $subscribers) {
						
					if (false !== ($pos = array_search($callable, $subscribers, TRUE))) {
						unset(
							$this->registry[$eventName][$priority][$pos],
							$this->sortedRegistry[$eventName]
						);
					}

				}
			}
		}
	}
public function removeSubscriber ( SubscriberInterface $ instance ) { // check for object hash if ( FALSE !== ( $ pos = array_search ( spl_object_hash ( $ instance ) , $ this -> registeredHashes ) ) ) { // remove instance from registry before re-inserting unset ( $ this -> registeredHashes [ $ pos ] ) ; foreach ( $ instance :: getEventsToSubscribe ( ) as $ eventName => $ parameters ) { $ methodName = array_shift ( $ parameters ) ; $ callable = array ( $ instance , $ methodName ) ; foreach ( $ this -> registry [ $ eventName ] as $ priority => $ subscribers ) { if ( false !== ( $ pos = array_search ( $ callable , $ subscribers , TRUE ) ) ) { unset ( $ this -> registry [ $ eventName ] [ $ priority ] [ $ pos ] , $ this -> sortedRegistry [ $ eventName ] ) ; } } } } }
remove a subscriber from the registry

@param SubscriberInterface $instance
remove a subscriber from the registry