From 89e9fdade72a4f83c5b65aef16d91d1832212655 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sat, 4 Dec 2021 23:22:24 +0000 Subject: [PATCH] More type information fixes --- src/PhpOption/LazyOption.php | 7 +++++-- src/PhpOption/Some.php | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PhpOption/LazyOption.php b/src/PhpOption/LazyOption.php index 0095927..9cb77c8 100644 --- a/src/PhpOption/LazyOption.php +++ b/src/PhpOption/LazyOption.php @@ -18,7 +18,7 @@ namespace PhpOption; -use Iterator; +use Traversable; /** * @template T @@ -137,7 +137,10 @@ public function reject($value) return $this->option()->reject($value); } - public function getIterator(): Iterator + /** + * @return Traversable + */ + public function getIterator(): Traversable { return $this->option()->getIterator(); } diff --git a/src/PhpOption/Some.php b/src/PhpOption/Some.php index f9a0063..032632e 100644 --- a/src/PhpOption/Some.php +++ b/src/PhpOption/Some.php @@ -149,6 +149,9 @@ public function reject($value) return $this; } + /** + * @return ArrayIterator + */ public function getIterator(): ArrayIterator { return new ArrayIterator([$this->value]);