Fixed handlerPriority order

This commit is contained in:
kotyara 2022-03-08 01:08:24 +05:00 • committed by GitHub
parent 2f44e5e76d
commit 0ef4318f6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,6 +106,7 @@ abstract class BaseEvent{
static::$handlers[$identifier] = $handler;
if(!isset(static::$handlerPriority[(int) $priority])){
static::$handlerPriority[(int) $priority] = array();
krsort(static::$handlerPriority);
}
static::$handlerPriority[(int) $priority][$identifier] = $handler;
return true;
@ -132,4 +133,4 @@ abstract class BaseEvent{
}
}
}
}