mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Updated PluginManager event deprecation message
This commit is contained in:
parent
6e8144d5d9
commit
60ca24fe0e
@ -689,8 +689,8 @@ class PluginManager{
|
||||
if(count($parameters) === 1 and $parameters[0]->getClass() instanceof \ReflectionClass and is_subclass_of($parameters[0]->getClass()->getName(), Event::class)){
|
||||
$class = $parameters[0]->getClass()->getName();
|
||||
$reflection = new \ReflectionClass($class);
|
||||
if(preg_match("/^[\t ]*\\* @deprecated[\t ]{1,}$/m", (string) $reflection->getDocComment(), $matches) > 0 and $this->server->getProperty("settings.deprecated-verbose", true)){
|
||||
$this->server->getLogger()->warning('"' . $plugin->getName() . '" has registered a listener for ' . $class . ' on method "' . get_class($listener) . '::' . $method . ', but the event is Deprecated.');
|
||||
if(strpos((string) $reflection->getDocComment(), "@deprecated") !== false and $this->server->getProperty("settings.deprecated-verbose", true)){
|
||||
$this->server->getLogger()->warning('Plugin ' . $plugin->getName() . ' has registered a listener for ' . $class . ' on method ' . get_class($listener) . '->' . $method->getName() . '(), but the event is Deprecated.');
|
||||
}
|
||||
$this->registerEvent($class, $listener, $priority, new MethodEventExecutor($method->getName()), $plugin, $ignoreCancelled);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user