library collection
Simple collections in PHP
jjgrainger/collection
Simple collections in PHP
- Monday, March 12, 2018
- by jjgrainger
- Repository
- 1 Watchers
- 1 Stars
- 1 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 2 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Collection v1.1
A collection class for working with arrays, (*1)
, (*2)
Principles
- Immutable - Most methods return a new collection, leaving the previous untouched
- Chainable - Methods can be chained to create fluent mapping and reduce original collection
Requirements
Installation
$ composer require jjgrainger/collection
Usage
$collection = new Collection([1, 2, 3]);
$total = $collection->sum(); // 6
Notes
Author
Joe Grainger, (*3)