jjgrainger/collection

Simple collections in PHP

Maintainers

Package info

github.com/jjgrainger/Collection

Homepage

pkg:composer/jjgrainger/collection

Statistics

Installs: 16

Dependents: 0

Suggesters: 0

Stars: 12

Open Issues: 0

1.1 2019-12-30 12:25 UTC

This package is auto-updated.

Last update: 2026-03-01 17:23:52 UTC


README

A collection class for working with arrays

tests codecov Latest Stable Version Total Downloads 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

Installation

$ composer require jjgrainger/collection

Usage

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

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

Notes

Author

Joe Grainger