Skip to content

Commit

Permalink
Change Iter\apply (Closure(T): void) $functionto `(Closure(T): …
Browse files Browse the repository at this point in the history
…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(...))
);
```
  • Loading branch information
devnix authored Apr 25, 2024
1 parent 79eb271 commit 8ea808a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psl/Iter/apply.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @template T
*
* @param iterable<T> $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
{
Expand Down

0 comments on commit 8ea808a

Please sign in to comment.