PHPackages                             ideade/typed-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ideade/typed-collections

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

ideade/typed-collections
========================

1.0.0(1y ago)07MITPHPPHP &gt;=8.0

Since Mar 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iDeaDe/typed-collections)[ Packagist](https://packagist.org/packages/ideade/typed-collections)[ RSS](/packages/ideade-typed-collections/feed)WikiDiscussions dungeon-master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

Typed collections
=================

[](#typed-collections)

PHP collections with runtime type checking

### Installation:

[](#installation)

`composer require ideade/typed-collections:~1.0`

### Supported types

[](#supported-types)

- Scalar: bool, int, float, string ✅
- Any of your classes ✅
- resource(including closed), array ❌

### Usage

[](#usage)

1. Define your collection class, or use one of scalar(from Ideade\\TypedCollections\\ScalarCollections):

```
use Ideade\TypedCollections\TypedCollection;

final class ExampleCollection extends TypedCollection
{
    protected function valueType() : string
    {
        return Example::class;
    }
}
```

2. Use it as a normal array, or use the following methods:

```
$collection = new ExampleCollection();

// Add an element
$collection->add(new Example());

// Get item by key
$collection->get(0);

// Add an element by key
$collection->addByKey(0, new Example());

// Delete element by key
$collection->remove(0);

// Set collection items (check the type of each item)
$collection->setItems([new Example(), new Example(), new Example()]);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~242 days

Total

2

Last Release

553d ago

Major Versions

0.1.0 → 1.0.02024-11-03

### Community

Maintainers

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

---

Top Contributors

[![iDeaDe](https://avatars.githubusercontent.com/u/8094412?v=4)](https://github.com/iDeaDe "iDeaDe (9 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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