mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-25 12:54:03 +00:00
GamemodeCommand: fix CommandSender assignment causing troubles for type inference on static analyzers
this would never crash, but in strongly typed code it would be a compile failure.
This commit is contained in:
parent
47a959dace
commit
ecbf3e9722
@ -60,7 +60,6 @@ class GamemodeCommand extends VanillaCommand{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$target = $sender;
|
|
||||||
if(isset($args[1])){
|
if(isset($args[1])){
|
||||||
$target = $sender->getServer()->getPlayer($args[1]);
|
$target = $sender->getServer()->getPlayer($args[1]);
|
||||||
if($target === null){
|
if($target === null){
|
||||||
@ -68,7 +67,9 @@ class GamemodeCommand extends VanillaCommand{
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}elseif(!($sender instanceof Player)){
|
}elseif($sender instanceof Player){
|
||||||
|
$target = $sender;
|
||||||
|
}else{
|
||||||
throw new InvalidCommandSyntaxException();
|
throw new InvalidCommandSyntaxException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user