diff --git a/lib/Coroutine.php b/lib/Coroutine.php index 886f6b4..5a3b4aa 100644 --- a/lib/Coroutine.php +++ b/lib/Coroutine.php @@ -33,7 +33,6 @@ final class Coroutine implements Promise try { if (\is_array($yielded)) { - /** @var array $yielded */ return Promise\all($yielded); } diff --git a/lib/Failure.php b/lib/Failure.php index 8cf1b16..4c1ea62 100644 --- a/lib/Failure.php +++ b/lib/Failure.php @@ -7,7 +7,8 @@ use React\Promise\PromiseInterface as ReactPromise; /** * Creates a failed promise using the given exception. * - * @template-implements Promise + * @template-covariant TValue + * @template-implements Promise */ final class Failure implements Promise { diff --git a/lib/Internal/Placeholder.php b/lib/Internal/Placeholder.php index 6f50db7..b84aa70 100644 --- a/lib/Internal/Placeholder.php +++ b/lib/Internal/Placeholder.php @@ -70,9 +70,11 @@ trait Placeholder } if (!$this->onResolved instanceof ResolutionQueue) { + /** @psalm-suppress InternalClass */ $this->onResolved = new ResolutionQueue($this->onResolved); } + /** @psalm-suppress InternalMethod */ $this->onResolved->push($onResolved); } diff --git a/lib/Internal/ResolutionQueue.php b/lib/Internal/ResolutionQueue.php index 3bfc535..353a8b9 100644 --- a/lib/Internal/ResolutionQueue.php +++ b/lib/Internal/ResolutionQueue.php @@ -11,7 +11,7 @@ use React\Promise\PromiseInterface as ReactPromise; * Stores a set of functions to be invoked when a promise is resolved. * * @internal - * @psalm-internal Amp + * @psalm-internal Amp\Internal */ class ResolutionQueue { diff --git a/lib/Loop/Driver.php b/lib/Loop/Driver.php index 1c49b5e..57d6862 100644 --- a/lib/Loop/Driver.php +++ b/lib/Loop/Driver.php @@ -134,6 +134,7 @@ abstract class Driver } } + /** @psalm-suppress RedundantCondition */ $this->dispatch(empty($this->nextTickQueue) && empty($this->enableQueue) && $this->running && !$this->isEmpty()); } diff --git a/lib/Loop/UvDriver.php b/lib/Loop/UvDriver.php index 91ea5d9..a0d73c1 100644 --- a/lib/Loop/UvDriver.php +++ b/lib/Loop/UvDriver.php @@ -171,6 +171,7 @@ class UvDriver extends Driver */ public function now(): int { + /** @psalm-suppress TooManyArguments */ return \uv_now($this->handle); } @@ -187,6 +188,7 @@ class UvDriver extends Driver */ protected function dispatch(bool $blocking) { + /** @psalm-suppress TooManyArguments */ \uv_run($this->handle, $blocking ? \UV::RUN_ONCE : \UV::RUN_NOWAIT); } diff --git a/psalm.xml b/psalm.xml index fe548ca..d6aa085 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,7 +1,7 @@