diff --git a/src/pocketmine/plugin/PluginManager.php b/src/pocketmine/plugin/PluginManager.php index 8c39dd27f..595f926cd 100644 --- a/src/pocketmine/plugin/PluginManager.php +++ b/src/pocketmine/plugin/PluginManager.php @@ -710,11 +710,14 @@ class PluginManager{ if(count($parameters) !== 1){ continue; } + + $handlerClosure = $method->getClosure($listener); + try{ $eventClass = $parameters[0]->getClass(); }catch(\ReflectionException $e){ //class doesn't exist if(isset($tags["softDepend"]) && !isset($this->plugins[$tags["softDepend"]])){ - $this->server->getLogger()->debug("Not registering @softDepend listener " . get_class($listener) . "::" . $method->getName() . "(" . $parameters[0]->getType()->getName() . ") because plugin \"" . $tags["softDepend"] . "\" not found"); + $this->server->getLogger()->debug("Not registering @softDepend listener " . Utils::getNiceClosureName($handlerClosure) . "(" . $parameters[0]->getType()->getName() . ") because plugin \"" . $tags["softDepend"] . "\" not found"); continue; } @@ -727,7 +730,7 @@ class PluginManager{ try{ $priority = isset($tags["priority"]) ? EventPriority::fromString($tags["priority"]) : EventPriority::NORMAL; }catch(\InvalidArgumentException $e){ - throw new PluginException("Event handler " . get_class($listener) . "->" . $method->getName() . "() declares invalid/unknown priority \"" . $tags["priority"] . "\""); + throw new PluginException("Event handler " . Utils::getNiceClosureName($handlerClosure) . "() declares invalid/unknown priority \"" . $tags["priority"] . "\""); } $ignoreCancelled = false; @@ -741,7 +744,7 @@ class PluginManager{ $ignoreCancelled = false; break; default: - throw new PluginException("Event handler " . get_class($listener) . "->" . $method->getName() . "() declares invalid @ignoreCancelled value \"" . $tags["ignoreCancelled"] . "\""); + throw new PluginException("Event handler " . Utils::getNiceClosureName($handlerClosure) . "() declares invalid @ignoreCancelled value \"" . $tags["ignoreCancelled"] . "\""); } }