PHPackages                             aircury/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. aircury/collection

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

aircury/collection
==================

Library to provide collection structures, to use instead of arrays

039.3k↓32.1%[2 PRs](https://github.com/aircury/collection/pulls)PHPCI passing

Since Jul 16Pushed 1mo ago10 watchersCompare

[ Source](https://github.com/aircury/collection)[ Packagist](https://packagist.org/packages/aircury/collection)[ RSS](/packages/aircury-collection/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (55)Used By (0)

Collection
==========

[](#collection)

PHP Arrays with additional functionality. Arrays on steroids.

Usage
-----

[](#usage)

There are two ways of using this library. To create Collections of objects or Collections of PHP scalar types.

### Object Collections

[](#object-collections)

To create you own Collection, the easiest way is to copy and adjust the sample `CarCollection`, replacing `Car` with the class that you need.

More generically, these are the steps to create your own Collection:

- Extend the `AbstractCollection` class
- Implement on the child these methods,
    - `getClass()` to provide information about the expected class or interface that all the objects on the collection should be.
    - `offsetGet($offset)` to specify the return class.
    - `toArray()` to provide PHPDoc information about the elements of the array.
    - `first()` to specify the return class.

### Scalar type Collections

[](#scalar-type-collections)

This library comes out of the box with the following Collections, ready to use:

- `StringCollection`
- `StringOrNullCollection`
- `IntegerCollection`
- `IntegerOrNullCollection`

These classes include additional expected functionality that you would expect from the data type, e.g. `implode()`, `sum()`, ...

If they do not suit your needs, you can extend any of them or the `AbstractScalarTypeCollection` to implement your own.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance59

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17073350?v=4)[Aircury](/maintainers/aircury)[@aircury](https://github.com/aircury)

---

Top Contributors

[![j-d](https://avatars.githubusercontent.com/u/1140726?v=4)](https://github.com/j-d "j-d (56 commits)")[![alejandrorey-aircury](https://avatars.githubusercontent.com/u/110761657?v=4)](https://github.com/alejandrorey-aircury "alejandrorey-aircury (10 commits)")[![aircury-bot](https://avatars.githubusercontent.com/u/32492530?v=4)](https://github.com/aircury-bot "aircury-bot (3 commits)")[![teresagutierrez-aircury](https://avatars.githubusercontent.com/u/150652475?v=4)](https://github.com/teresagutierrez-aircury "teresagutierrez-aircury (2 commits)")[![IvanTC95](https://avatars.githubusercontent.com/u/9695557?v=4)](https://github.com/IvanTC95 "IvanTC95 (1 commits)")[![ivantocon-aircury](https://avatars.githubusercontent.com/u/264689017?v=4)](https://github.com/ivantocon-aircury "ivantocon-aircury (1 commits)")[![haasecanosa](https://avatars.githubusercontent.com/u/25693320?v=4)](https://github.com/haasecanosa "haasecanosa (1 commits)")[![jesusjaen](https://avatars.githubusercontent.com/u/1171916?v=4)](https://github.com/jesusjaen "jesusjaen (1 commits)")[![jesusjaen-aircury](https://avatars.githubusercontent.com/u/264689429?v=4)](https://github.com/jesusjaen-aircury "jesusjaen-aircury (1 commits)")[![AntonioCheca](https://avatars.githubusercontent.com/u/9285650?v=4)](https://github.com/AntonioCheca "AntonioCheca (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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