Skip to content

Commit

Permalink
refactor: Update Pipe operation - remove call_user_func.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Apr 20, 2021
1 parent e5d2ca5 commit d31df6f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Operation/Pipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use Generator;
use Iterator;

use function call_user_func;

/**
* @psalm-template TKey
* @psalm-template TKey of array-key
Expand Down Expand Up @@ -46,7 +44,7 @@ static function (Iterator $iterator) use ($operations): Iterator {
*
* @psalm-return Iterator<TKey, T>
*/
static fn (Iterator $iterator, callable $callable): Iterator => call_user_func($callable, $iterator);
static fn (Iterator $iterator, callable $callable): Iterator => $callable($iterator);

return array_reduce($operations, $callback, $iterator);
};
Expand Down

0 comments on commit d31df6f

Please sign in to comment.