add @CommandArgument annotation

* add @CommandArgument and relevant event changes

* fix unknown bug

* remove relative constant for CommandArgument
This commit is contained in:
Jerry Ma
2022-05-03 10:06:57 +08:00
committed by GitHub
parent a393b3aff5
commit d19d7acedd
10 changed files with 359 additions and 14 deletions

View File

@@ -23,6 +23,8 @@ class EventManager
public static $middleware_map = [];
public static $event_map = [];
public static $middlewares = [];
public static $req_mapping = [];
@@ -33,6 +35,7 @@ class EventManager
Console::debug("Adding event {$event_name} at @Anonymous");
} else {
Console::debug("Adding event {$event_name} at " . ($event_obj->class) . ':' . ($event_obj->method));
self::$event_map[$event_obj->class][$event_obj->method][] = $event_obj;
}
self::$events[$event_name][] = $event_obj;
(new AnnotationParser())->sortByLevel(self::$events, $event_name);