From 8ea808a494976ad623cbf0843c26f8b8e0a0a8b8 Mon Sep 17 00:00:00 2001 From: Pablo Largo Mohedano Date: Thu, 25 Apr 2024 14:04:34 +0200 Subject: [PATCH] Change `Iter\apply` `(Closure(T): void)` `$function`to `(Closure(T): mixed)` (#471) If the return type is not going to be used, it does not make sense to enforce it. For example, there are cases like arrow functions that are incompatible, and force to use longer versions just because of the implicit return, for example: ```php Psl\Iter\apply( $items, fn (Item $item) => $q($item)->then($this->processItem(...)) ); ``` --- src/Psl/Iter/apply.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psl/Iter/apply.php b/src/Psl/Iter/apply.php index b5cf68f9..f41c4eea 100644 --- a/src/Psl/Iter/apply.php +++ b/src/Psl/Iter/apply.php @@ -12,7 +12,7 @@ * @template T * * @param iterable $iterable Iterable to apply on - * @param (Closure(T): void) $function Apply function + * @param (Closure(T): mixed) $function Apply function */ function apply(iterable $iterable, Closure $function): void {