2017 © Pedro Peláez
 

library collection

PHP collection manipulation class - supports iterators and generators

image

vakata/collection

PHP collection manipulation class - supports iterators and generators

  • Friday, May 25, 2018
  • by vakata
  • Repository
  • 1 Watchers
  • 0 Stars
  • 760 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 12 % Grown

The README.md

collection

Latest Version on Packagist ![Software License][ico-license] Build Status Scrutinizer Code Quality ![Code Coverage][ico-scrutinizer], (*1)

A PHP class for fast iterables manipulation (arrays, generators, iterators)., (*2)

All predicate / mutator callables receive the current value, current key and the whole collection as arguments., (*3)

map & filter do not execute immediately, but instead stack up until you need to get a value (calling squash, toArray, value). Where possible helpers use map & filter in order to minimize RAM usage. This means that it is possible to iterate through a large file reading line by line while maintaining a minimal memory footprint., (*4)

Install

Via Composer, (*5)

``` bash composer require vakata/collection, (*6)


## Usage ``` php $collection = \vakata\collection\Collection::from([1,2,3,4,5,6]); $result = $collection ->filter(function ($v) { return $v % 2 === 0; }) ->map(function ($v) { return $v + 1; }) ->head(2) ->toArray();

Read more in the API docs, (*7)

Testing

bash composer test, (*8)

Contributing

Please see CONTRIBUTING for details., (*9)

Security

If you discover any security related issues, please email github@vakata.com instead of using the issue tracker., (*10)

Credits

A big thanks to im0rtality and the great Underscore package, (*11)

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

25/05 2018

dev-master

9999999-dev

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

25/05 2018

1.5.0

1.5.0.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

28/09 2017

1.4.0

1.4.0.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

25/05 2017

1.3.0

1.3.0.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

24/04 2017

1.2.0

1.2.0.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

21/03 2017

1.1.2

1.1.2.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

19/03 2017

1.1.1

1.1.1.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

19/03 2017

1.1.0

1.1.0.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

17/03 2017

1.0.1

1.0.1.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata

16/03 2017

1.0.0

1.0.0.0

PHP collection manipulation class - supports iterators and generators

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

collection vakata