emonkak/collection

This package is abandoned and no longer maintained. No replacement package was suggested.

A collection library as a container for aggregation of objects

v2.0.0 2015-12-16 10:05 UTC

This package is auto-updated.

Last update: 2024-01-19 00:08:04 UTC


README

Build Status Coverage Status

A collection library as a container for aggregation of objects.

Requirements

Licence

MIT Licence

Example

// Take five elements from a infinite list of even numbers.
Collection::iterate(0, function($n) { return $n + 1; })
    ->filter(function($n) { return $n % 2 === 0; })
    ->take(5)
    ->each(function($n) { echo $n, PHP_EOL; });
// => 0
//    2
//    4
//    6
//    8

Documentation

Please see Wiki. (but wiki pages are Japanese only)