This commit is contained in:
2020-09-15 19:09:12 +08:00
parent 31b336b9a7
commit f27cec805d
2 changed files with 8 additions and 9 deletions
+8 -8
View File
@@ -64,16 +64,16 @@ class Context extends BaseContext
if (!static::hasContext($id)) { if (!static::hasContext($id)) {
Coroutine::getContext()[$id] = []; Coroutine::getContext()[$id] = [];
} }
if (empty($key)) { if (!empty($key)) {
return Coroutine::getContext()[$id] = $context; if (!is_array(Coroutine::getContext()[$id])) {
} Coroutine::getContext()[$id] = [$key => $context];
$oldData = Coroutine::getContext()[$id]; } else {
if (!is_array($oldData)) { Coroutine::getContext()[$id][$key] = $context;
$oldData = [$key => $context]; }
} else { } else {
$oldData[$key] = $context; Coroutine::getContext()[$id] = $context;
} }
return Coroutine::getContext()[$id] = $oldData; return $context;
} }
/** /**
-1
View File
@@ -403,7 +403,6 @@ class Request extends Application
} }
/** /**
* @param $router
* @return bool * @return bool
*/ */
public function isNotFound() public function isNotFound()