amo / collection
Collection Abstraction library extended
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/amo/collection
Requires
- php: ^7.1 || ^8.0
- doctrine/collections: >=1.5
Requires (Dev)
- phpunit/phpunit: >=6.5
This package is not auto-updated.
Last update: 2025-10-02 00:16:57 UTC
README
Collection management, heavily inspired by Doctrine ArrayCollection
Install
composer require amo/collection
Usages
// Static instantiation Collection::make($repository->findBy($criterias)) // map method, allows to create a new collection // based on each item of the given collection ->map(function(User $user){ return $user->getEmail(); }) // each method, executes a closure fore each item of a collection ->each(function(String $email) { $message = $this->buildMessage($email); $this->mailer->send($message); }); // etc...