PHPackages                             buttress/collecterator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. buttress/collecterator

ActiveLibrary

buttress/collecterator
======================

A collection class powered by generators

2.0.1(1y ago)331221MITPHPPHP ^8.1CI passing

Since Mar 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/buttress/collecterator)[ Packagist](https://packagist.org/packages/buttress/collecterator)[ Docs](https://github.com/buttress/collecterator)[ RSS](/packages/buttress-collecterator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (5)Used By (1)

Collecterator: Generator based collections
==========================================

[](#collecterator-generator-based-collections)

[![Latest Version on Packagist](https://camo.githubusercontent.com/097467aa2e318ad2140fabc762a4b2e13c1142efba6df76335b9a922bfbf58fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62757474726573732f636f6c6c656374657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/buttress/collecterator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d365799723e0be37470550ca6737e1f2c3624bd67ada7ae5121fa2aca66c1491/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62757474726573732f636f6c6c656374657261746f722f746573742e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/buttress/collecterator/actions)[![Total Downloads](https://camo.githubusercontent.com/ec50b50e65a42ce0a1da366bce0f3877fc392e73149e74185a46cd83116c0635/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62757474726573732f636f6c6c656374657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/buttress/collecterator)

This library is a fully featured `\Generator` based Collection implementation. The goal is to provide a memory efficient fast collection implementation that makes it possible to use familiar collection methods to work with infinite or very large streams.

Our tests were largely copied from [`tightenco/collect`](https://packagist.org/packages/tightenco/collect) with many modifications added to support the deferred processing you get with `Generators`.

For basic usage, see [the `AllMethods.php` example](examples/AllMethods.php)

Install
-------

[](#install)

Via Composer

```
$ composer require buttress/collecterator
```

Usage
-----

[](#usage)

```
$collection = GeneratorCollection::make([1,2,3]);
$collection->filter(function(int $value) {
    return $value % 2;
});

$array = $collection->all();
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](https://github.com/buttress/collecterator/releases) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Korvin Szanto](https://github.com/korvinszanto)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance47

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~986 days

Total

4

Last Release

397d ago

Major Versions

1.0.1 → 2.0.02023-06-11

PHP version history (2 changes)1.0.0PHP ~7.1

2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/842d2fe13512e82f0f9b6f0d79dba8eba1595a3cefd31dd51723960436133307?d=identicon)[KorvinSzanto](/maintainers/KorvinSzanto)

---

Top Contributors

[![KorvinSzanto](https://avatars.githubusercontent.com/u/1007419?v=4)](https://github.com/KorvinSzanto "KorvinSzanto (7 commits)")

---

Tags

bycollectionsgeneratorsphppoweredButtresscollecterator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/buttress-collecterator/health.svg)

```
[![Health](https://phpackages.com/badges/buttress-collecterator/health.svg)](https://phpackages.com/packages/buttress-collecterator)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
