add PHP8 Attribute compatibility (build 439, 2.7.0-beta4)

This commit is contained in:
crazywhalecc
2022-03-20 01:53:36 +08:00
parent 12363aebf0
commit c897da29c6
42 changed files with 355 additions and 40 deletions

View File

@@ -30,7 +30,10 @@ class EventTracer
public static function getCurrentEventMiddlewares()
{
$current_event = self::getCurrentEvent();
if (!isset($current_event->class, $current_event->method)) {
if (empty($current_event->class)) {
return null;
}
if (empty($current_event->method)) {
return null;
}
return EventManager::$middleware_map[$current_event->class][$current_event->method] ?? [];