eventName === null ? get_class($this) : $this->eventName; } /** * @return bool * * @throws \BadMethodCallException */ public function isCancelled(){ if(!($this instanceof Cancellable)){ throw new \BadMethodCallException("Event is not Cancellable"); } /** @var Event $this */ return $this->isCancelled === true; } /** * @param bool $value * * @return bool * * @throws \BadMethodCallException */ public function setCancelled($value = true){ if(!($this instanceof Cancellable)){ throw new \BadMethodCallException("Event is not Cancellable"); } /** @var Event $this */ $this->isCancelled = (bool) $value; } /** * @return HandlerList */ public function getHandlers(){ if(static::$handlerList === null){ static::$handlerList = new HandlerList(); } return static::$handlerList; } }