mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Added callable type hinting
This commit is contained in:
parent
7acbf13a8a
commit
8bf4b5cafa
@ -193,7 +193,7 @@ class PocketMinecraftServer{
|
||||
|
||||
}
|
||||
|
||||
public function addHandler($event, $callable, $priority = 5){
|
||||
public function addHandler($event,callable $callable, $priority = 5){
|
||||
if(!is_callable($callable)){
|
||||
return false;
|
||||
}elseif(isset(Deprecation::$events[$event])){
|
||||
@ -656,7 +656,7 @@ class PocketMinecraftServer{
|
||||
}
|
||||
}
|
||||
|
||||
public function schedule($ticks, $callback, $data = array(), $repeat = false, $eventName = "server.schedule"){
|
||||
public function schedule($ticks,callable $callback, $data = array(), $repeat = false, $eventName = "server.schedule"){
|
||||
if(!is_callable($callback)){
|
||||
return false;
|
||||
}
|
||||
@ -698,7 +698,7 @@ class PocketMinecraftServer{
|
||||
$this->preparedSQL->updateActions->execute();
|
||||
}
|
||||
|
||||
public function event($event, $func){
|
||||
public function event($event,callable $func){
|
||||
if(!is_callable($func)){
|
||||
return false;
|
||||
}elseif(isset(Deprecation::$events[$event])){
|
||||
|
Loading…
x
Reference in New Issue
Block a user