added native types to closures (phpstan-strict-rules)

This commit is contained in:
Dylan K. Taylor
2020-02-05 16:35:10 +00:00
parent fd2a7797bd
commit fa82cb26d8
20 changed files with 24 additions and 24 deletions

View File

@@ -63,7 +63,7 @@ class BanListCommand extends VanillaCommand{
}
$list = $list->getEntries();
$message = implode(", ", array_map(function(BanEntry $entry){
$message = implode(", ", array_map(function(BanEntry $entry) : string{
return $entry->getName();
}, $list));

View File

@@ -47,9 +47,9 @@ class ListCommand extends VanillaCommand{
return true;
}
$playerNames = array_map(function(Player $player){
$playerNames = array_map(function(Player $player) : string{
return $player->getName();
}, array_filter($sender->getServer()->getOnlinePlayers(), function(Player $player) use ($sender){
}, array_filter($sender->getServer()->getOnlinePlayers(), function(Player $player) use ($sender) : bool{
return $player->isOnline() and (!($sender instanceof Player) or $sender->canSee($player));
}));

View File

@@ -52,7 +52,7 @@ class TeleportCommand extends VanillaCommand{
return true;
}
$args = array_values(array_filter($args, function($arg){
$args = array_values(array_filter($args, function(string $arg) : bool{
return $arg !== "";
}));
if(count($args) < 1 or count($args) > 6){