mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Fixed PHP 8.0 deprecation error
This commit is contained in:
parent
e156fb47e8
commit
988cf7f535
@ -703,7 +703,15 @@ class PluginManager{
|
||||
$handlerClosure = $method->getClosure($listener);
|
||||
|
||||
try{
|
||||
$eventClass = $parameters[0]->getClass();
|
||||
$paramType = $parameters[0]->getType();
|
||||
//isBuiltin() returns false for builtin classes ..................
|
||||
if($paramType instanceof \ReflectionNamedType && !$paramType->isBuiltin()){
|
||||
/** @phpstan-var class-string $paramClass */
|
||||
$paramClass = $paramType->getName();
|
||||
$eventClass = new \ReflectionClass($paramClass);
|
||||
}else{
|
||||
$eventClass = null;
|
||||
}
|
||||
}catch(\ReflectionException $e){ //class doesn't exist
|
||||
if(isset($tags["softDepend"]) && !isset($this->plugins[$tags["softDepend"]])){
|
||||
$this->server->getLogger()->debug("Not registering @softDepend listener " . Utils::getNiceClosureName($handlerClosure) . "() because plugin \"" . $tags["softDepend"] . "\" not found");
|
||||
|
Loading…
x
Reference in New Issue
Block a user