mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
PluginManager: Allow @ignoreCancelled annotation on event handlers to not have parameters (#2294)
This commit is contained in:
parent
066c990301
commit
7a164a8254
@ -794,7 +794,21 @@ class PluginManager{
|
||||
}catch(\InvalidArgumentException $e){
|
||||
throw new PluginException("Event handler " . get_class($listener) . "->" . $method->getName() . "() declares invalid/unknown priority \"" . $tags["priority"] . "\"");
|
||||
}
|
||||
$ignoreCancelled = isset($tags["ignoreCancelled"]) && strtolower($tags["ignoreCancelled"]) === "true";
|
||||
|
||||
$ignoreCancelled = false;
|
||||
if(isset($tags["ignoreCancelled"])){
|
||||
switch(strtolower($tags["ignoreCancelled"])){
|
||||
case "true":
|
||||
case "":
|
||||
$ignoreCancelled = true;
|
||||
break;
|
||||
case "false":
|
||||
$ignoreCancelled = false;
|
||||
break;
|
||||
default:
|
||||
throw new PluginException("Event handler " . get_class($listener) . "->" . $method->getName() . "() declares invalid @ignoreCancelled value \"" . $tags["ignoreCancelled"] . "\"");
|
||||
}
|
||||
}
|
||||
|
||||
$parameters = $method->getParameters();
|
||||
try{
|
||||
|
Loading…
x
Reference in New Issue
Block a user