From 67fe588279a9e49b372d55646bd972871c788a46 Mon Sep 17 00:00:00 2001 From: VennV <111500380+VennDev@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:29:04 +0700 Subject: [PATCH] Fix phpstan! --- src/vennv/vapm/ChildCoroutine.php | 26 ++++++++++++++++++++++++-- src/vennv/vapm/Mutex.php | 4 ++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/vennv/vapm/ChildCoroutine.php b/src/vennv/vapm/ChildCoroutine.php index db1abe27d..353a9183a 100644 --- a/src/vennv/vapm/ChildCoroutine.php +++ b/src/vennv/vapm/ChildCoroutine.php @@ -29,12 +29,34 @@ interface ChildCoroutineInterface { + /** + * @param Exception $exception + * @return void + * + * This function sets the exception. + */ public function setException(Exception $exception): void; - public function run(): ChildCoroutineInterface; + /** + * @return ChildCoroutine + * + * This function runs the coroutine. + */ + public function run(): ChildCoroutine; + + /** + * @return bool + * + * This function checks if the coroutine is finished. + */ public function isFinished(): bool; + /** + * @return mixed + * + * This function returns the return value of the coroutine. + */ public function getReturn(): mixed; } @@ -56,7 +78,7 @@ public function setException(Exception $exception): void $this->exception = $exception; } - public function run(): ChildCoroutineInterface + public function run(): ChildCoroutine { $this->coroutine->send($this->coroutine->current()); return $this; diff --git a/src/vennv/vapm/Mutex.php b/src/vennv/vapm/Mutex.php index 52880b455..143cfd9a2 100644 --- a/src/vennv/vapm/Mutex.php +++ b/src/vennv/vapm/Mutex.php @@ -67,7 +67,7 @@ public function isLocked(): bool } /** - * @return void + * @return Generator * * This function locks the mutex. */ @@ -80,7 +80,7 @@ public function lock(): Generator } /** - * @return void + * @return Generator * * This function unlocks the mutex. */