protected function removeObserversByEvent(string $event, callable $callback): EventInterface
    {
        //if event isn't set
        if (!isset($this->observers[$event])) {
            //do nothing
            return $this;
        }

        //'foobar' => array(
        foreach ($this->observers[$event] as $i => $observer) {
            //0 => callback
            if ($observer['observer']->assertEquals($callback)) {
                unset($this->observers[$event][$i]);
            }
        }

        return $this;
    }
protected function removeObserversByEvent(string $event, callable $callback): EventInterface
    {
        //if event isn't set
        if (!isset($this->observers[$event])) {
            //do nothing
            return $this;
        }

        //'foobar' => array(
        foreach ($this->observers[$event] as $i => $observer) {
            //0 => callback
            if ($observer['observer']->assertEquals($callback)) {
                unset($this->observers[$event][$i]);
            }
        }

        return $this;
    }
protected function removeObserversByEvent ( string $ event , callable $ callback ) : EventInterface { //if event isn't set if ( ! isset ( $ this -> observers [ $ event ] ) ) { //do nothing return $ this ; } //'foobar' => array( foreach ( $ this -> observers [ $ event ] as $ i => $ observer ) { //0 => callback if ( $ observer [ 'observer' ] -> assertEquals ( $ callback ) ) { unset ( $ this -> observers [ $ event ] [ $ i ] ) ; } } return $ this ; }
Removes all observers matching this event and callback

@param *string   $event
@param *callable $callback

@return EventInterface
Removes all observers matching this event and callback