mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
HandlerListManager: make resolveNearestHandleableParent() a little easier to follow
and also sidestep phpstan complaining about using loop vars outside of loop
This commit is contained in:
parent
fd675449e9
commit
85f3dca11b
@ -71,10 +71,13 @@ class HandlerListManager{
|
|||||||
* @phpstan-return \ReflectionClass<Event>|null
|
* @phpstan-return \ReflectionClass<Event>|null
|
||||||
*/
|
*/
|
||||||
private static function resolveNearestHandleableParent(\ReflectionClass $class) : ?\ReflectionClass{
|
private static function resolveNearestHandleableParent(\ReflectionClass $class) : ?\ReflectionClass{
|
||||||
for($parent = $class->getParentClass(); $parent !== false && !self::isValidClass($parent); $parent = $parent->getParentClass()){
|
for($parent = $class->getParentClass(); $parent !== false; $parent = $parent->getParentClass()){
|
||||||
|
if(self::isValidClass($parent)){
|
||||||
|
return $parent;
|
||||||
|
}
|
||||||
//NOOP
|
//NOOP
|
||||||
}
|
}
|
||||||
return $parent ?: null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user