src/EventManager.php
public function detach(ObserverInterface $observer)
    {
        $observers = $this->getObservers();

        foreach ($observer->getEvents() as $event) {
            $count = count($observers[$event]);

            for ($i = 0; $i < $count; $i++) {
                if ($observers[$event][$i] == $observer) {
                    unset($observers[$event][$i]);
                }
            }
        }

        $this->setObservers($observers);
    }
public function detach(ObserverInterface $observer)
    {
        $observers = $this->getObservers();

        foreach ($observer->getEvents() as $event) {
            $count = count($observers[$event]);

            for ($i = 0; $i < $count; $i++) {
                if ($observers[$event][$i] == $observer) {
                    unset($observers[$event][$i]);
                }
            }
        }

        $this->setObservers($observers);
    }
public function detach ( ObserverInterface $ observer ) { $ observers = $ this -> getObservers ( ) ; foreach ( $ observer -> getEvents ( ) as $ event ) { $ count = count ( $ observers [ $ event ] ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { if ( $ observers [ $ event ] [ $ i ] == $ observer ) { unset ( $ observers [ $ event ] [ $ i ] ) ; } } } $ this -> setObservers ( $ observers ) ; }
Method responsible for removing observers from event manager
@param  ObserverInterface $observer
Method responsible for removing observers from event manager