PHPackages                             yellowcable/collection - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yellowcable/collection

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yellowcable/collection
======================

Collection and Aggregation.

2.0.0(2y ago)11.1k1CC0-1.0PHPPHP ^8.1

Since Jul 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yellowcableRick/collection)[ Packagist](https://packagist.org/packages/yellowcable/collection)[ Docs](https://yellowcable.nl)[ RSS](/packages/yellowcable-collection/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (11)Used By (1)

Collection
----------

[](#collection)

> Collection and Aggregation library for PHP8.2+

Create object collections and be in control of iteration and access.
--------------------------------------------------------------------

[](#create-object-collections-and-be-in-control-of-iteration-and-access)

- You can either extend the abstract or implement and use the interfaces and traits.
- Aggregation is simple; it clears the content of the collections!

Usage
-----

[](#usage)

To use a Collection, make sure you create or instantiate:

```
$collection = new ItemCollection("test", [
    new Item("1", 1, 1),
    new Item("1", 1, 1),
    new Item("1", 1, 1),
    new Item("1", 1, 1),
]);
-----------------------------------------------
$collection = new class () extends Collection
{
    public function getClass(): string
    {
        return Item::class;
    }
};

```

Aggregations are possible in the same fashion as Collections:

```
$agg = new ItemAggregation("bliep");
$agg->addCollection(new ItemCollection("test", [new Item("item", 1, 1)]), false);

```

Notes
-----

[](#notes)

- Don't use stdClass if you want to serialize; PHP will not allow it.

Contribute
----------

[](#contribute)

Contributions are always welcome! Suggestions are only welcome in the form of code.

License
-------

[](#license)

[![CC0](https://camo.githubusercontent.com/dc5dafd103feb167be372f069c52972bd8cd86cf2fdfc28a1b8aa44e35463b27/68747470733a2f2f6c6963656e7365627574746f6e732e6e65742f702f7a65726f2f312e302f38387833312e706e67)](https://creativecommons.org/publicdomain/zero/1.0/)

To the extent possible under law, [Yellow Cable](http://yellowcable.nl) has waived all copyright and related or neighboring rights to this work.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~25 days

Recently: every ~15 days

Total

10

Last Release

797d ago

Major Versions

1.0.9 → 2.0.02024-03-12

PHP version history (2 changes)1.0.0PHP ^8.2

1.0.2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e2a5d3ddd9743cdb3ab0b01b836870da00c3bcd35635522bc1f3105a87affda?d=identicon)[yellowcable](/maintainers/yellowcable)

---

Top Contributors

[![yellowcableRick](https://avatars.githubusercontent.com/u/131004396?v=4)](https://github.com/yellowcableRick "yellowcableRick (37 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/yellowcable-collection/health.svg)

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

###  Alternatives

[botman/botman

Create messaging bots in PHP with ease.

6.2k1.5M97](/packages/botman-botman)[tabuna/breadcrumbs

An easy way to add breadcrumbs to your Laravel app.

4163.4M13](/packages/tabuna-breadcrumbs)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[amphp/parallel-functions

Parallel processing made simple.

27910.3M26](/packages/amphp-parallel-functions)[laravie/serialize-queries

Serializable Laravel Query Builder

707.1M4](/packages/laravie-serialize-queries)[tormjens/eventy

The WordPress filter/action system in Laravel

438912.9k16](/packages/tormjens-eventy)

PHPackages © 2026

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