Skip to content

Commit 2bb6795

Browse files
authored
Merge pull request #27 from Bl00D4NGEL/fix/generic-return-type-hint
fix: Add T as a possible return type for lastOr and firstOr
2 parents 337df9b + 5d2e735 commit 2bb6795

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Domain/Collection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function first(callable $callback = null)
200200
* @template U of T|mixed
201201
* @param ?callable(T, int, static): bool $callback
202202
* @param U $fallbackValue
203-
* @return U
203+
* @return U|T
204204
* @throws InvalidArgumentException
205205
*/
206206
public function firstOr(callable $callback = null, mixed $fallbackValue = null)
@@ -250,7 +250,7 @@ public function last(callable $callback = null)
250250
* @template U of T|mixed
251251
* @param ?callable(T, int, static): bool $callback
252252
* @param U $fallbackValue
253-
* @return U
253+
* @return U|T
254254
* @throws InvalidArgumentException
255255
*/
256256
public function lastOr(callable $callback = null, mixed $fallbackValue = null)

0 commit comments

Comments
 (0)