PHPackages                             slava-basko/cakephp-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. slava-basko/cakephp-collection

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

slava-basko/cakephp-collection
==============================

Work easily with arrays and iterators by having a battery of utility traversal methods

1.0.0(3y ago)09501[1 PRs](https://github.com/slava-basko/collection/pulls)MITPHPPHP ^5

Since Aug 9Pushed 3y agoCompare

[ Source](https://github.com/slava-basko/collection)[ Packagist](https://packagist.org/packages/slava-basko/cakephp-collection)[ Docs](https://cakephp.org)[ RSS](/packages/slava-basko-cakephp-collection/feed)WikiDiscussions master Synced 2d ago

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

CakePHP Collection Library port for PHP 5
=========================================

[](#cakephp-collection-library-port-for-php-5)

The collection classes provide a set of tools to manipulate arrays or Traversable objects. If you have ever used underscore.js, you have an idea of what you can expect from the collection classes.

Usage
-----

[](#usage)

Collections can be created using an array or Traversable object. A simple use of a Collection would be:

```
use Cake\Collection\Collection;

$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);

// Create a new collection containing elements
// with a value greater than one.
$overOne = $collection->filter(function ($value, $key, $iterator) {
    return $value > 1;
});
```

The `Collection\CollectionTrait` allows you to integrate collection-like features into any Traversable object you have in your application as well.

Documentation
-------------

[](#documentation)

Please make sure you check the [official documentation](https://book.cakephp.org/4/en/core-libraries/collections.html)

How to run tests
----------------

[](#how-to-run-tests)

Install dependencies

```
docker run -v `pwd`:/var/www --rm feitosa/php55-with-composer composer install
```

Run tests

```
docker run -v `pwd`:/var/www --rm feitosa/php55-with-composer vendor/bin/phpunit
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

1371d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a8e37b4c52b1cfe4f5d64f420d21875ebdeb53954d6859d6d663038b95ef3cc?d=identicon)[slava-basko](/maintainers/slava-basko)

---

Top Contributors

[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (112 commits)")[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (68 commits)")[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (56 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (21 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (15 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (14 commits)")[![antograssiot](https://avatars.githubusercontent.com/u/4977112?v=4)](https://github.com/antograssiot "antograssiot (13 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (9 commits)")[![hytromo](https://avatars.githubusercontent.com/u/131824?v=4)](https://github.com/hytromo "hytromo (7 commits)")[![Iandenh](https://avatars.githubusercontent.com/u/2911923?v=4)](https://github.com/Iandenh "Iandenh (6 commits)")[![letstalk-nl](https://avatars.githubusercontent.com/u/9513230?v=4)](https://github.com/letstalk-nl "letstalk-nl (5 commits)")[![dakota](https://avatars.githubusercontent.com/u/83255?v=4)](https://github.com/dakota "dakota (4 commits)")[![chinpei215](https://avatars.githubusercontent.com/u/7399393?v=4)](https://github.com/chinpei215 "chinpei215 (4 commits)")[![darensipes](https://avatars.githubusercontent.com/u/840593?v=4)](https://github.com/darensipes "darensipes (2 commits)")[![mylux](https://avatars.githubusercontent.com/u/11030522?v=4)](https://github.com/mylux "mylux (2 commits)")[![robertpustulka](https://avatars.githubusercontent.com/u/7437773?v=4)](https://github.com/robertpustulka "robertpustulka (2 commits)")[![Theaxiom](https://avatars.githubusercontent.com/u/57013?v=4)](https://github.com/Theaxiom "Theaxiom (1 commits)")[![ataylor32](https://avatars.githubusercontent.com/u/1054222?v=4)](https://github.com/ataylor32 "ataylor32 (1 commits)")[![bravo-kernel](https://avatars.githubusercontent.com/u/230500?v=4)](https://github.com/bravo-kernel "bravo-kernel (1 commits)")[![dilab](https://avatars.githubusercontent.com/u/218813?v=4)](https://github.com/dilab "dilab (1 commits)")

---

Tags

cakephpcollectionsiteratorsarrays

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slava-basko-cakephp-collection/health.svg)

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

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k411.1M1.2k](/packages/doctrine-collections)[cakephp/collection

Work easily with arrays and iterators by having a battery of utility traversal methods

899.9M10](/packages/cakephp-collection)[ilya/belt

A handful of tools for PHP developers.

71020.8k1](/packages/ilya-belt)[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)

PHPackages © 2026

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