diff --git a/kiri-engine/Context.php b/kiri-engine/Context.php index 7903ddd5..8e66c4e7 100644 --- a/kiri-engine/Context.php +++ b/kiri-engine/Context.php @@ -110,12 +110,12 @@ class Context extends BaseContext /** * @param null $coroutineId - * @return mixed + * @return Coroutine\Context|array */ - public static function getAllContext($coroutineId = null): mixed + public static function getAllContext($coroutineId = null): Coroutine\Context|array { if (Coroutine::getCid() === -1) { - return Coroutine::getContext($coroutineId) ?? []; + return Coroutine::getContext((int)$coroutineId) ?? []; } else { return static::$_contents ?? []; } diff --git a/kiri-engine/Main.php b/kiri-engine/Main.php index ffac2e00..57204bb5 100644 --- a/kiri-engine/Main.php +++ b/kiri-engine/Main.php @@ -58,6 +58,7 @@ class Main extends BaseMain $error->registerShutdownHandler(Config::get('error.shutdown', [])); $error->registerExceptionHandler(Config::get('error.exception', [])); $error->registerErrorHandler(Config::get('error.error', [])); + $this->id = Config::get('id', uniqid('id.')); } /**