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

Abandoned → [atournayre/framework](/?search=atournayre%2Fframework)Library[Utility &amp; Helpers](/categories/utility)

atournayre/collection
=====================

Collections library.

0.8.1(2y ago)0141MITPHPPHP &gt;=8.1

Since Mar 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/atournayre/collection)[ Packagist](https://packagist.org/packages/atournayre/collection)[ RSS](/packages/atournayre-collection/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (0)

Atournayre Collection
=====================

[](#atournayre-collection)

This library provides a way to manipulate collections.

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

[](#installation)

Use [Composer](https://getcomposer.org) to install the package:

```
composer require atournayre/collection
```

Collections
-----------

[](#collections)

MethodDescription`TypedCollection::createAsList()`Create a list from an array`TypedCollection::createAsMap()`Create a map from an array`TypedCollectionImmutable::createAsList()`Create an immutable list from an array`TypedCollectionImmutable::createAsMap()`Create an immutable map from an array`DecimalValueCollection::fromArray()`Create a collection of DecimalValue from an array`DecimalValuePrecisionConsistentCollection::fromArray()`Create a collection of DecimalValue with precision consistent from an arrayExamples
--------

[](#examples)

### Typed Collection

[](#typed-collection)

```
// Samples classes
class Person
{
    public function __construct(
        public string $name
    ) {}
}

class People extends TypedCollection
{
    protected static string $type = Person::class;
}
```

```
// Create collection
$collection = People::createAsList([
    new Person('John'),
]);
$collection[] = new Person('Jack'); // Add item
```

### Typed Collection Immutable

[](#typed-collection-immutable)

```
// Samples classes
class Person
{
    public function __construct(
        public string $name
    ) {}
}

class People extends TypedCollectionImmutable
{
    protected static string $type = Person::class;
}
```

```
// Create collection
$collection = People::createAsList([
    new Person('John'),
]);
$collection[] = new Person('Jack'); // Throws a RuntimeException
```

### Decimal Collection

[](#decimal-collection)

```
$collection = DecimalValueCollection::fromArray([
    DecimalValue::create(4.235, 3),
    DecimalValue::fromInt(1),
    DecimalValue::fromString('2'),
    DecimalValue::fromFloat(3.01, 2),
], 2);
$collection[0]->toFloat(); // 4.24
$collection[1]->toFloat(); // 1.00
$collection[2]->toFloat(); // 2.00
$collection[3]->toFloat(); // 3.01
```

Contribute
----------

[](#contribute)

Contributions to the package are always welcome!

- Report any bugs or issues you find on the [issue tracker](https://github.com/atournayre/collection/issues).
- You can grab the source code at the package's [Git repository](https://github.com/atournayre/collection).

License
-------

[](#license)

All contents of this package are licensed under the [MIT license](LICENSE).

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.8% 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 ~39 days

Recently: every ~4 days

Total

12

Last Release

771d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/be702ea3d10de6d97d83c32866fc9cfe1830a055e7f8b685c8434ccad40416c1?d=identicon)[atournayre](/maintainers/atournayre)

---

Top Contributors

[![atournayre](https://avatars.githubusercontent.com/u/4262077?v=4)](https://github.com/atournayre "atournayre (44 commits)")[![mend-bolt-for-github[bot]](https://avatars.githubusercontent.com/in/16809?v=4)](https://github.com/mend-bolt-for-github[bot] "mend-bolt-for-github[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[akeneo/pim-community-dev

Akeneo PIM, the future of catalog management is open!

1.0k620.8k86](/packages/akeneo-pim-community-dev)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5255.7M110](/packages/symplify-monorepo-builder)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12524.8M137](/packages/phpdocumentor-reflection)[sylius/promotion

Flexible promotion management for PHP applications.

28495.4k13](/packages/sylius-promotion)

PHPackages © 2026

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