diff --git a/Context/AsyncContext.php b/Context/AsyncContext.php index c2ab25d..a438c77 100644 --- a/Context/AsyncContext.php +++ b/Context/AsyncContext.php @@ -62,9 +62,9 @@ class AsyncContext implements ContextInterface * @param string $id * @param int $value * @param int|null $coroutineId - * @return bool|int + * @return int */ - public static function increment(string $id, int $value = 1, ?int $coroutineId = null): bool|int + public static function increment(string $id, int $value = 1, ?int $coroutineId = null): int { if (!isset(static::$context[$id])) { static::$context[$id] = 0; @@ -76,9 +76,9 @@ class AsyncContext implements ContextInterface * @param string $id * @param int $value * @param int|null $coroutineId - * @return bool|int + * @return int */ - public static function decrement(string $id, int $value = 1, ?int $coroutineId = null): bool|int + public static function decrement(string $id, int $value = 1, ?int $coroutineId = null): int { if (!isset(static::$context[$id])) { static::$context[$id] = 0; diff --git a/Context/ContextInterface.php b/Context/ContextInterface.php index 10526d0..1da1e0d 100644 --- a/Context/ContextInterface.php +++ b/Context/ContextInterface.php @@ -41,19 +41,19 @@ interface ContextInterface /** * @param string $id * @param int $value - * @param $coroutineId - * @return bool|int + * @param null $coroutineId + * @return int */ - public static function increment(string $id, int $value = 1, $coroutineId = null): bool|int; + public static function increment(string $id, int $value = 1, $coroutineId = null): int; /** * @param string $id * @param int $value - * @param $coroutineId - * @return bool|int + * @param null $coroutineId + * @return int */ - public static function decrement(string $id, int $value = 1, $coroutineId = null): bool|int; + public static function decrement(string $id, int $value = 1, $coroutineId = null): int; } diff --git a/Context/CoroutineContext.php b/Context/CoroutineContext.php index af0e39d..84e925b 100644 --- a/Context/CoroutineContext.php +++ b/Context/CoroutineContext.php @@ -72,9 +72,9 @@ class CoroutineContext implements ContextInterface * @param string $id * @param int $value * @param int|null $coroutineId - * @return bool|int + * @return int */ - public static function increment(string $id, int $value = 1, ?int $coroutineId = null): bool|int + public static function increment(string $id, int $value = 1, ?int $coroutineId = null): int { if (is_null($coroutineId)) { $coroutineId = Coroutine::getCid(); @@ -89,9 +89,9 @@ class CoroutineContext implements ContextInterface * @param string $id * @param int $value * @param int|null $coroutineId - * @return bool|int + * @return int */ - public static function decrement(string $id, int $value = 1, ?int $coroutineId = null): bool|int + public static function decrement(string $id, int $value = 1, ?int $coroutineId = null): int { if (is_null($coroutineId)) { $coroutineId = Coroutine::getCid();