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)`

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 committed Apr 22, 2024
1 parent 79eb271 commit 6ace52e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psl/Iter/apply.php
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 6ace52e

Please sign in to comment.