Skip to content

Commit b60ea9c

Browse files
committed
fix: Add T as a possible return type for lastOr and firstOr
1 parent 989debf commit b60ea9c

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
@@ -163,7 +163,7 @@ public function first(callable $callback = null)
163163
* @template U of T|mixed
164164
* @param ?callable(T, int, static): bool $callback
165165
* @param U $fallbackValue
166-
* @return U
166+
* @return U|T
167167
* @throws InvalidArgumentException
168168
*/
169169
public function firstOr(callable $callback = null, mixed $fallbackValue = null)
@@ -213,7 +213,7 @@ public function last(callable $callback = null)
213213
* @template U of T|mixed
214214
* @param ?callable(T, int, static): bool $callback
215215
* @param U $fallbackValue
216-
* @return U
216+
* @return U|T
217217
* @throws InvalidArgumentException
218218
*/
219219
public function lastOr(callable $callback = null, mixed $fallbackValue = null)

0 commit comments

Comments
 (0)