Apply a function over all the items of a collection
- fn
- Function to apply to every item in the collection.
- coll
- Collection of values to apply the function.
Save a bunch of entities:
<?php
use function Lambdish\Phunctional\each;
return each(
function (User $user) use (UserRepository $repository) {
$repository->save($user);
},
[
User::register('Horus'),
User::register('Osiris'),
User::register('Isis'),
]
);
// => null