PHPackages                             epfremme/collections - 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. epfremme/collections

ActiveLibrary

epfremme/collections
====================

PHP Collection Classes

v1.0.2(10y ago)1217MITPHPPHP &gt;=5.4

Since Dec 7Pushed 9y ago3 watchersCompare

[ Source](https://github.com/epfremmer/collections)[ Packagist](https://packagist.org/packages/epfremme/collections)[ RSS](/packages/epfremme-collections/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

PHP Collections
===============

[](#php-collections)

[![Build Status](https://camo.githubusercontent.com/c9b070d987f0e7168de9c952ade8e8abc43e2b7a882e35c9ab67b0c5be5d1abf/68747470733a2f2f7472617669732d63692e6f72672f65706672656d6d65722f636f6c6c656374696f6e732e737667)](https://travis-ci.org/epfremmer/collections?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/32dfa29c75869655c8edde09d8fc116512af98ff12b95f8a1ca8688e7b0e4255/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65706672656d6d65722f636f6c6c656374696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/epfremmer/collections/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c99799a3e85517023bd67b51841cf883e62ef39bc948f37ab6ea740c5887b192/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65706672656d6d65722f636f6c6c656374696f6e732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/epfremmer/collections/?branch=master)

Overview
--------

[](#overview)

This library was intended to provide base PHP collection classes that can be extended to provide application specific functionality.

There are 3 main collection classes provided by default:

- BaseCollection - This is a basic iterable collection very similar in capabilities to ArrayObject
- Collection - An extension of BaseCollection with added methods for conventional array access &amp; modifications
- ImmutableCollection - Another extension of BaseCollection but with all remove/write capabilities disabled

The primary components of each collection is also included as PHP traits to assist in the creation of any custom collection classes that can't simply extend one of the included collection class objects. Each of the traits included is designed to meet SPL Traversable Interface methods. Each trait has the expectation that the class using it can access an $elements member variable on the collection class.

### Collection Traits

[](#collection-traits)

- ArrayAccessTrait - Satisfies SPL ArrayAccess Interface
- ClearableTrait - Adds methods to clear and test emptiness of collections
- CountableTrait - Satisfies SPL Countable Interface
- IterableTrait - Satisfies SPL Iterator Interface
- SearchableTrait - Adds methods to better search &amp; filter collections
- SeekableTrait - Satisfies SPL SeekableIterator Interface (also requires IterableTrait)

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

[](#installation)

- `composer require epfremme/collections`
- `composer install`

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~0 days

Total

3

Last Release

3758d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/676986caba2c215a2d21d09ec73a55fccbe180f9d9c511fc0d1753f2bfd05461?d=identicon)[epfremmer](/maintainers/epfremmer)

---

Top Contributors

[![epfremmer](https://avatars.githubusercontent.com/u/1810965?v=4)](https://github.com/epfremmer "epfremmer (3 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/epfremme-collections/health.svg)

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

PHPackages © 2026

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