Handler inheritance is now working

this code should also perform somewhat better
This commit is contained in:
Dylan K. Taylor
2024-11-13 20:35:14 +00:00
parent fa796535ff
commit 8aed5d6b27
6 changed files with 141 additions and 81 deletions

View File

@ -58,11 +58,12 @@ final class AsyncEventInheritanceTest extends Test{
$plugin = $this->getPlugin();
$classes = self::EXPECTED_ORDER;
shuffle($classes);
foreach($classes as $event){
foreach($classes as $class){
$plugin->getServer()->getPluginManager()->registerAsyncEvent(
$event,
function(AsyncEvent $event) : ?Promise{
$this->callOrder[] = $event::class;
$class,
function(AsyncEvent $event) use ($class) : ?Promise{
var_dump($class);
$this->callOrder[] = $class;
return null;
},
EventPriority::NORMAL,