taskHandler; } public function getName() : string{ return Utils::getNiceClassName($this); } final public function setHandler(?TaskHandler $taskHandler) : void{ if($this->taskHandler === null || $taskHandler === null){ $this->taskHandler = $taskHandler; } } /** * Actions to execute when run * * @throws CancelTaskException */ abstract public function onRun() : void; /** * Actions to execute if the Task is cancelled */ public function onCancel() : void{ } }