phpdoc armageddon for master, pass 1

This commit is contained in:
Dylan K. Taylor
2020-01-22 11:55:03 +00:00
parent 4bae3baa74
commit 67bcc1c0fb
397 changed files with 0 additions and 5391 deletions

View File

@ -52,57 +52,27 @@ class TaskScheduler{
/** @var int */
protected $currentTick = 0;
/**
* @param null|string $owner
*/
public function __construct(?string $owner = null){
$this->owner = $owner;
$this->queue = new ReversePriorityQueue();
}
/**
* @param Task $task
*
* @return TaskHandler
*/
public function scheduleTask(Task $task) : TaskHandler{
return $this->addTask($task, -1, -1);
}
/**
* @param Task $task
* @param int $delay
*
* @return TaskHandler
*/
public function scheduleDelayedTask(Task $task, int $delay) : TaskHandler{
return $this->addTask($task, $delay, -1);
}
/**
* @param Task $task
* @param int $period
*
* @return TaskHandler
*/
public function scheduleRepeatingTask(Task $task, int $period) : TaskHandler{
return $this->addTask($task, -1, $period);
}
/**
* @param Task $task
* @param int $delay
* @param int $period
*
* @return TaskHandler
*/
public function scheduleDelayedRepeatingTask(Task $task, int $delay, int $period) : TaskHandler{
return $this->addTask($task, $delay, $period);
}
/**
* @param int $taskId
*/
public function cancelTask(int $taskId) : void{
if(isset($this->tasks[$taskId])){
try{
@ -124,22 +94,11 @@ class TaskScheduler{
$this->ids = 1;
}
/**
* @param int $taskId
*
* @return bool
*/
public function isQueued(int $taskId) : bool{
return isset($this->tasks[$taskId]);
}
/**
* @param Task $task
* @param int $delay
* @param int $period
*
* @return TaskHandler
*
* @throws \InvalidStateException
*/
private function addTask(Task $task, int $delay, int $period) : TaskHandler{
@ -183,9 +142,6 @@ class TaskScheduler{
$this->enabled = $enabled;
}
/**
* @param int $currentTick
*/
public function mainThreadHeartbeat(int $currentTick) : void{
$this->currentTick = $currentTick;
while($this->isReady($this->currentTick)){
@ -210,9 +166,6 @@ class TaskScheduler{
return !$this->queue->isEmpty() and $this->queue->current()->getNextRun() <= $currentTick;
}
/**
* @return int
*/
private function nextId() : int{
return $this->ids++;
}