From be23a272ba65e9d96dc9839688c274506277c73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 3 Apr 2023 11:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Context/AsyncContext.php | 8 ++++---- Context/ContextInterface.php | 8 ++++---- Context/CoroutineContext.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Context/AsyncContext.php b/Context/AsyncContext.php index a019b4f..c2ab25d 100644 --- a/Context/AsyncContext.php +++ b/Context/AsyncContext.php @@ -59,12 +59,12 @@ class AsyncContext implements ContextInterface } /** - * @param $id + * @param string $id * @param int $value * @param int|null $coroutineId * @return bool|int */ - public static function increment($id, int $value = 1, ?int $coroutineId = null): bool|int + public static function increment(string $id, int $value = 1, ?int $coroutineId = null): bool|int { if (!isset(static::$context[$id])) { static::$context[$id] = 0; @@ -73,12 +73,12 @@ class AsyncContext implements ContextInterface } /** - * @param $id + * @param string $id * @param int $value * @param int|null $coroutineId * @return bool|int */ - public static function decrement($id, int $value = 1, ?int $coroutineId = null): bool|int + public static function decrement(string $id, int $value = 1, ?int $coroutineId = null): bool|int { if (!isset(static::$context[$id])) { static::$context[$id] = 0; diff --git a/Context/ContextInterface.php b/Context/ContextInterface.php index 973b67c..10526d0 100644 --- a/Context/ContextInterface.php +++ b/Context/ContextInterface.php @@ -39,21 +39,21 @@ interface ContextInterface /** - * @param $id + * @param string $id * @param int $value * @param $coroutineId * @return bool|int */ - public static function increment($id, int $value = 1, $coroutineId = null): bool|int; + public static function increment(string $id, int $value = 1, $coroutineId = null): bool|int; /** - * @param $id + * @param string $id * @param int $value * @param $coroutineId * @return bool|int */ - public static function decrement($id, int $value = 1, $coroutineId = null): bool|int; + public static function decrement(string $id, int $value = 1, $coroutineId = null): bool|int; } diff --git a/Context/CoroutineContext.php b/Context/CoroutineContext.php index 6a0cec3..4476e44 100644 --- a/Context/CoroutineContext.php +++ b/Context/CoroutineContext.php @@ -60,12 +60,12 @@ class CoroutineContext implements ContextInterface /** - * @param $id + * @param string $id * @param int $value * @param int|null $coroutineId * @return bool|int */ - public static function increment($id, int $value = 1, ?int $coroutineId = null): bool|int + public static function increment(string $id, int $value = 1, ?int $coroutineId = null): bool|int { if (is_null($coroutineId)) { $coroutineId = Coroutine::getCid(); @@ -77,12 +77,12 @@ class CoroutineContext implements ContextInterface } /** - * @param $id + * @param string $id * @param int $value * @param int|null $coroutineId * @return bool|int */ - public static function decrement($id, int $value = 1, ?int $coroutineId = null): bool|int + public static function decrement(string $id, int $value = 1, ?int $coroutineId = null): bool|int { if (is_null($coroutineId)) { $coroutineId = Coroutine::getCid();