src/Events/EventEmitter.php
public function replaceEventHandler($event, callable $delegate)
    {
        if (isset($this->eventHandlers[$event])) {
            $this->eventHandlers[$event] = [];
        }

        $this->attachEventHandler($event, $delegate);
    }
public function replaceEventHandler($event, callable $delegate)
    {
        if (isset($this->eventHandlers[$event])) {
            $this->eventHandlers[$event] = [];
        }

        $this->attachEventHandler($event, $delegate);
    }
public function replaceEventHandler ( $ event , callable $ delegate ) { if ( isset ( $ this -> eventHandlers [ $ event ] ) ) { $ this -> eventHandlers [ $ event ] = [ ] ; } $ this -> attachEventHandler ( $ event , $ delegate ) ; }
Attach an event handler as the sole handler for this event.

Removes all previously attached handlers.

@param $event
@param callable $delegate
Attach an event handler as the sole handler for this event .