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

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

mparulski/collection-type
=========================

The library Collection/Map and subtypes with checking the types for PHP

v0.5.0(10y ago)630[2 issues](https://github.com/mparulski/collection-type/issues)MITPHPPHP &gt;=5.5.0

Since Apr 4Pushed 10y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (0)

CollectionType
==============

[](#collectiontype)

================

[![License](https://camo.githubusercontent.com/9ddb156329f2190537f37131f0f8055cacfb5ee207c064da0a99f91644f0233f/68747470733a2f2f706f7365722e707567782e6f72672f6d706172756c736b692f636f6c6c656374696f6e2d747970652f6c6963656e73652e737667)](https://packagist.org/packages/mparulski/collection-type)[![Latest Stable Version](https://camo.githubusercontent.com/1dbf9044c8c380bb35b92c0d128815b68b9ff0cedf0ed368cac890865067612a/68747470733a2f2f706f7365722e707567782e6f72672f6d706172756c736b692f636f6c6c656374696f6e2d747970652f762f737461626c652e737667)](https://packagist.org/packages/mparulski/collection-type)[![Total Downloads](https://camo.githubusercontent.com/0055a9c9e9f5afa6149179abf6453c956e5d9f58123f09e1a5cf71a656770180/68747470733a2f2f706f7365722e707567782e6f72672f6d706172756c736b692f636f6c6c656374696f6e2d747970652f646f776e6c6f616473)](https://packagist.org/packages/mparulski/collection-type)

CollectionType is a library that provides Collection and Map with their subtypes which are checking types of data set for PHP.

Requirements
------------

[](#requirements)

---

- PHP 5.5.0 or higher

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

[](#installation)

---

CollectionType officially supports only installation through Composer. For Composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

Install the module:

```
$ php composer.phar require mparulski/collection-type:0.*
```

Example:
--------

[](#example)

---

```
use CollectionType\Collection\CollectionSet\HashSet;
use CollectionType\TypeValidator\ObjectTypeValidator;

$set = new HashSet(new IntegerTypeValidator());

$set->add(1);
$set->add(5);

// throw exception
$set->add(7.2);
```

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

[](#documentation)

---

Documentation is available in the [/docs](/docs) folder.

LICENSE
=======

[](#license)

Copyright (c) 2015 Michał Parulski

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the MIT license.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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 ~38 days

Total

3

Last Release

3985d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89404362e8e6922eec4404e5b57d25d72387a6dfd997fc4aa0e0af24851da974?d=identicon)[mparulski](/maintainers/mparulski)

---

Top Contributors

[![mparulski](https://avatars.githubusercontent.com/u/9919033?v=4)](https://github.com/mparulski "mparulski (35 commits)")

---

Tags

phpphp-libraryphp5phptypemapcollection

### Embed Badge

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

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

###  Alternatives

[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.2k412.9k11](/packages/aimeos-map)[zakirullin/mess

Convenient array-related routine &amp; better type casting

21228.9k2](/packages/zakirullin-mess)[chdemko/sorted-collections

Sorted Collections for PHP &gt;= 8.2

222.5M3](/packages/chdemko-sorted-collections)[strictus/strictus

Strict Typing for local variables in PHP

1606.9k](/packages/strictus-strictus)

PHPackages © 2026

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