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

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

meekframework/collection
========================

v0.3.0(7y ago)013MITPHP

Since May 27Pushed 7y ago1 watchersCompare

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

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

MeekFramework 'Collection' Component
====================================

[](#meekframework-collection-component)

Provides implementations and contracts for dealing with data structures.

The data type of the first element added to any collection implementation then becomes the only supported type for that collection instance.

Example using scalar types:

```
$stack = new Meek\Collection\UnboundedStack();

$stack->push('1');  // All future push() operations will only accept the string data type.

$stack->push(2);    // Throws an InvalidArgumentException -> must be a string
```

Example using objects:

```
class MyClass extends stdClass {}

$stack = new Meek\Collection\UnboundedStack();

$stack->push(new stdClass());   // All future push() operations will only accept instances of `stdClass`.
$stack->push(new MyClass());    // Works fine as `MyClass` is sub-classed from `stdClass`

$stack->push(new class {});    // Throws an InvalidArgumentException -> must be an instance of "stdClass"
```

Usage
-----

[](#usage)

### Stack

[](#stack)

Reversing a string using an `UnboundedStack`:

```
$wordToReverse = 'dog';
$stack = new Meek\Collection\UnboundedStack(...str_split($wordToReverse));
$reversedWord = '';

while ($stack->size() > 0) {
    $reversedWord .= $stack->pop();
}

print $reversedWord;    // prints 'god'
```

Keeping track of history using a `BoundedStack`:

```
$numberOfActionsToKeepTrackOf = 3;
$stack = new Meek\Collection\BoundedStack($numberOfActionsToKeepTrackOf);

$perform = function ($action) use ($stack) {
    $stack->push($action);
    echo sprintf('perform: %s', $action);
};

$undo = function () use ($stack) {
    $action = $stack->pop();
    echo sprintf('undo: %s', $action);
};

$perform('select all');     // prints 'perform: select all'
$perform('copy');           // prints 'perform: copy'
$perform('paste');          // prints 'perform: paste'
$undo();                    // prints 'undo: paste'
$perform('paste');          // prints 'perform: paste'

try {
    $perform('select all');
} catch (OverflowException $e) {
    // clear history and keep going or notify user that history is full
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Total

3

Last Release

2909d ago

### Community

Maintainers

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

---

Top Contributors

[![nbish11](https://avatars.githubusercontent.com/u/1518821?v=4)](https://github.com/nbish11 "nbish11 (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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