public function setEventHandler(EventInterface $handler, bool $static = false)
    {
        if ($static) {
            self::$globalEventHandler = $handler;
        }

        $this->eventHandler = $handler;

        return $this;
    }
public function setEventHandler(EventInterface $handler, bool $static = false)
    {
        if ($static) {
            self::$globalEventHandler = $handler;
        }

        $this->eventHandler = $handler;

        return $this;
    }
public function setEventHandler ( EventInterface $ handler , bool $ static = false ) { if ( $ static ) { self :: $ globalEventHandler = $ handler ; } $ this -> eventHandler = $ handler ; return $ this ; }
Allow for a custom dispatcher to be used

@param *EventInterface $handler
@param bool            $static

@return EventTrait
Allow for a custom dispatcher to be used