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

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

aeviiq/collection
=================

A library that provides strict typed collections in PHP.

v4.0.2(2y ago)633.6k↓26.9%55MITPHPPHP ^8.1

Since May 26Pushed 2y ago3 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (33)Used By (5)

Aeviiq PHP Typed Collections
============================

[](#aeviiq-php-typed-collections)

Why
---

[](#why)

To provide an easy way to ensure type safety on collections/arrays and provide useful custom methods for object collections, as seen in the example below.

Installation
------------

[](#installation)

```
composer require aeviiq/collection

```

Declaration
-----------

[](#declaration)

```
/**
 * @extends ObjectCollection
 *
 * @method \ArrayIterator|Foo[] getIterator()
 * @method Foo|null first()
 * @method Foo|null last()
 */
final class FooCollection extends ObjectCollection
{
    public function filterReleasedBefore(\DateTimeInterface $dateTime): FooCollection
    {
        return $this->filter(static function (Foo $foo) use ($dateTime): bool {
            return $foo->getReleaseDate() < $dateTime;
        });
    }

    public function filterActives(): FooCollection
    {
        return $this->filter(static function (Foo $foo): bool {
            return $foo->isActive();
        });
    }

    protected function allowedInstance(): string
    {
        return Foo::class;
    }
}
```

Usage
-----

[](#usage)

```
// Useful custom methods for ObjectCollections:
$fooCollection = new FooCollection([$foo1, $foo2]);
$result = $fooCollection->filterReleasedBefore(new DateTime('now'))->filterActives();

// Basic type collections that are provided
$intCollection = new IntCollection([1, 2]);
$intCollection->append(3);

$intCollection = new IntCollection([1, '2']); // InvalidArgumentException thrown
$intCollection->append('3');  // InvalidArgumentException thrown
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 83.4% 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 ~56 days

Recently: every ~19 days

Total

32

Last Release

819d ago

Major Versions

1.0.x-dev → v2.02019-07-16

2.0.x-dev → v3.02019-08-24

v3.6.1 → v4.02023-12-07

PHP version history (4 changes)v1.0PHP &gt;=7.2

v1.0.1PHP ^7.2

3.4.x-devPHP ^7.2 || ^8.0

v4.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![aeviiq](https://avatars.githubusercontent.com/u/34397049?v=4)](https://github.com/aeviiq "aeviiq (176 commits)")[![nvdbeek](https://avatars.githubusercontent.com/u/923311?v=4)](https://github.com/nvdbeek "nvdbeek (14 commits)")[![nusje2000](https://avatars.githubusercontent.com/u/17175959?v=4)](https://github.com/nusje2000 "nusje2000 (11 commits)")[![dbrekelmans](https://avatars.githubusercontent.com/u/9531344?v=4)](https://github.com/dbrekelmans "dbrekelmans (8 commits)")[![Chi-teck](https://avatars.githubusercontent.com/u/673139?v=4)](https://github.com/Chi-teck "Chi-teck (2 commits)")

---

Tags

phpcollectiontyped-collectionaeviiq

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[werxe/laravel-collection-macros

Custom Laravel Collection macros.

2625.8k](/packages/werxe-laravel-collection-macros)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[rotexsoft/versatile-collections

A collection package that can be extended to implement things such as a Dependency Injection Container, RecordSet objects for housing database records, a bag of http cookies, or technically any collection of items that can be looped over and whose items can each be accessed using array-access syntax or object property syntax.

186.0k1](/packages/rotexsoft-versatile-collections)[jshannon63/jsoncollect

Supercharge your JSON using collections

154.9k1](/packages/jshannon63-jsoncollect)

PHPackages © 2026

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