This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
Simple collections in PHP
1.1 2019-12-30 12:25 UTC
A collection class for working with arrays
- Immutable - Most methods return a new collection, leaving the previous untouched
- Chainable - Methods can be chained to create fluent mapping and reduce original collection
- PHP >=7.2
$ composer require jjgrainger/collection
$collection = new Collection([1, 2, 3]); $total = $collection->sum(); // 6
- This project was created to learn unit testing, not intended for production use.
- Inspired by Laravel Collections
- Licensed under the MIT License
- Maintained under the Semantic Versioning Guide