taskHandler; } /** * @return int */ public final function getTaskId(){ if($this->taskHandler !== null){ return $this->taskHandler->getTaskId(); } return -1; } /** * @param TaskHandler $taskHandler */ public final function setHandler($taskHandler){ if($this->taskHandler === null or $taskHandler === null){ $this->taskHandler = $taskHandler; } } /** * Actions to execute when run * * @param $currentTick * * @return void */ public abstract function onRun($currentTick); /** * Actions to execute if the Task is cancelled */ public function onCancel(){ } }