From 71d7f5674c8e07826a02bafe8d8b86d5b9d0266d Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sat, 28 Mar 2020 14:25:39 +0100 Subject: [PATCH] Increase psalm error level to level 5 --- lib/Internal/Producer.php | 5 +++++ lib/Producer.php | 9 ++++++++- psalm.xml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/Internal/Producer.php b/lib/Internal/Producer.php index ad6a786..33751a3 100644 --- a/lib/Internal/Producer.php +++ b/lib/Internal/Producer.php @@ -15,6 +15,7 @@ use React\Promise\PromiseInterface as ReactPromise; * before emitting values. * * @internal + * @template-covariant TValue */ trait Producer { @@ -41,6 +42,8 @@ trait Producer /** * {@inheritdoc} + * + * @return Promise */ public function advance(): Promise { @@ -72,6 +75,8 @@ trait Producer /** * {@inheritdoc} + * + * @return Promise */ public function getCurrent() { diff --git a/lib/Producer.php b/lib/Producer.php index 828f2c8..82895f6 100644 --- a/lib/Producer.php +++ b/lib/Producer.php @@ -2,12 +2,19 @@ namespace Amp; +/** + * @template-covariant TValue + * @template-implements Iterator + */ final class Producer implements Iterator { + /** + * @use Internal\Producer + */ use CallableMaker, Internal\Producer; /** - * @param callable(callable(mixed $value): Promise $emit): \Generator $producer + * @param callable(callable(TValue $value): Promise $emit): \Generator $producer * * @throws \Error Thrown if the callable does not return a Generator. */ diff --git a/psalm.xml b/psalm.xml index 4605917..fe548ca 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,7 +1,7 @@