diff --git a/src/Operation/Has.php b/src/Operation/Has.php index 9fa5e6a80..7db311745 100644 --- a/src/Operation/Has.php +++ b/src/Operation/Has.php @@ -33,23 +33,17 @@ public function __invoke(): Closure * * @return Closure(iterable): Generator */ - static function (callable ...$callbacks): Closure { - /** @var Closure(iterable): Generator $matchOne */ - $matchOne = (new MatchOne())()(static fn (): bool => true)( - ...array_map( - static fn (callable $callback): callable => + static fn (callable ...$callbacks): Closure => (new MatchOne())()(static fn (): bool => true)( + ...array_map( + static fn (callable $callback): callable => /** * @param T $value * @param TKey $key * @param iterable $iterable */ static fn ($value, $key, iterable $iterable): bool => $callback($value, $key, $iterable) === $value, - $callbacks - ) - ); - - // Point free style. - return $matchOne; - }; + $callbacks + ) + ); } } diff --git a/src/Operation/IntersectKeys.php b/src/Operation/IntersectKeys.php index d6e4761e8..31adf3784 100644 --- a/src/Operation/IntersectKeys.php +++ b/src/Operation/IntersectKeys.php @@ -34,16 +34,13 @@ public function __invoke(): Closure * @return Closure(iterable): Generator */ static function (...$keys): Closure { - $filter = (new Filter())()( + return (new Filter())()( /** * @param T $value * @param TKey $key */ static fn ($value, $key): bool => in_array($key, $keys, true) ); - - // Point free style. - return $filter; }; } }