mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Moar typehints
This commit is contained in:
@@ -58,7 +58,7 @@ class TaskHandler{
|
||||
* @param int $delay
|
||||
* @param int $period
|
||||
*/
|
||||
public function __construct($timingName, Task $task, $taskId, $delay = -1, $period = -1){
|
||||
public function __construct(string $timingName, Task $task, int $taskId, int $delay = -1, int $period = -1){
|
||||
$this->task = $task;
|
||||
$this->taskId = $taskId;
|
||||
$this->delay = $delay;
|
||||
@@ -71,63 +71,63 @@ class TaskHandler{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isCancelled(){
|
||||
public function isCancelled() : bool{
|
||||
return $this->cancelled === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getNextRun(){
|
||||
public function getNextRun() : int{
|
||||
return $this->nextRun;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $ticks
|
||||
*/
|
||||
public function setNextRun($ticks){
|
||||
public function setNextRun(int $ticks){
|
||||
$this->nextRun = $ticks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTaskId(){
|
||||
public function getTaskId() : int{
|
||||
return $this->taskId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Task
|
||||
*/
|
||||
public function getTask(){
|
||||
public function getTask() : Task{
|
||||
return $this->task;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDelay(){
|
||||
public function getDelay() : int{
|
||||
return $this->delay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isDelayed(){
|
||||
public function isDelayed() : bool{
|
||||
return $this->delay > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isRepeating(){
|
||||
public function isRepeating() : bool{
|
||||
return $this->period > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPeriod(){
|
||||
public function getPeriod() : int{
|
||||
return $this->period;
|
||||
}
|
||||
|
||||
@@ -150,14 +150,14 @@ class TaskHandler{
|
||||
/**
|
||||
* @param int $currentTick
|
||||
*/
|
||||
public function run($currentTick){
|
||||
public function run(int $currentTick){
|
||||
$this->task->onRun($currentTick);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTaskName(){
|
||||
public function getTaskName() : string{
|
||||
if($this->timingName !== null){
|
||||
return $this->timingName;
|
||||
}
|
||||
|
Reference in New Issue
Block a user