1
This commit is contained in:
@@ -24,11 +24,14 @@ class Context extends BaseContext
|
|||||||
*/
|
*/
|
||||||
public static function setContext($id, $context, $coroutineId = null): mixed
|
public static function setContext($id, $context, $coroutineId = null): mixed
|
||||||
{
|
{
|
||||||
if (Coroutine::getCid() === -1) {
|
if (is_null($coroutineId)) {
|
||||||
return static::$_contents[$id] = $context;
|
$coroutineId = Coroutine::getCid();
|
||||||
}
|
}
|
||||||
|
if (Coroutine::getCid() !== -1) {
|
||||||
return Coroutine::getContext($coroutineId)[$id] = $context;
|
return Coroutine::getContext($coroutineId)[$id] = $context;
|
||||||
}
|
}
|
||||||
|
return static::$_contents[$id] = $context;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $id
|
* @param $id
|
||||||
|
|||||||
Reference in New Issue
Block a user