From b60ea9c3985620b11960902b65dad114d95ea0e4 Mon Sep 17 00:00:00 2001 From: Bl00D4NGEL Date: Tue, 30 Jan 2024 13:42:45 +0100 Subject: [PATCH] fix: Add T as a possible return type for lastOr and firstOr --- src/Domain/Collection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Domain/Collection.php b/src/Domain/Collection.php index f1d99e2..56fae29 100644 --- a/src/Domain/Collection.php +++ b/src/Domain/Collection.php @@ -163,7 +163,7 @@ public function first(callable $callback = null) * @template U of T|mixed * @param ?callable(T, int, static): bool $callback * @param U $fallbackValue - * @return U + * @return U|T * @throws InvalidArgumentException */ public function firstOr(callable $callback = null, mixed $fallbackValue = null) @@ -213,7 +213,7 @@ public function last(callable $callback = null) * @template U of T|mixed * @param ?callable(T, int, static): bool $callback * @param U $fallbackValue - * @return U + * @return U|T * @throws InvalidArgumentException */ public function lastOr(callable $callback = null, mixed $fallbackValue = null)