From 0ef4318f6fdf6b0ff25957aa7caab926469a7195 Mon Sep 17 00:00:00 2001 From: kotyara <62548070+kotyaralih@users.noreply.github.com> Date: Tue, 8 Mar 2022 01:08:24 +0500 Subject: [PATCH] Fixed handlerPriority order --- src/BaseEvent.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BaseEvent.php b/src/BaseEvent.php index 38b81c85..35182030 100644 --- a/src/BaseEvent.php +++ b/src/BaseEvent.php @@ -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{ } } -} \ No newline at end of file +}