jjgrainger/collection

Simple collections in PHP

1.0 2018-03-12 14:28 UTC

README

A collection class for working with arrays

Build Status Total Downloads Latest Stable Version License

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

  • PHP v5.3
  • Composer

Installation

$ composer require jjgrainger/collection

Usage


$collection = new Collection([1, 2, 3]);

$total = $collection->sum(); // 6