Skip to content

Commit

Permalink
Merge pull request #27 from Bl00D4NGEL/fix/generic-return-type-hint
Browse files Browse the repository at this point in the history
fix: Add T as a possible return type for lastOr and firstOr
  • Loading branch information
Bl00D4NGEL authored Feb 9, 2024
2 parents 337df9b + 5d2e735 commit 2bb6795
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Domain/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,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)
Expand Down Expand Up @@ -250,7 +250,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)
Expand Down

0 comments on commit 2bb6795

Please sign in to comment.