PluginManager: Allow @ignoreCancelled annotation on event handlers to not have parameters (#2294)

This commit is contained in:
Dylan K. Taylor 2018-07-12 17:12:14 +01:00 committed by GitHub
parent 066c990301
commit 7a164a8254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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{