PHPackages                             ehough/chaingang - 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. ehough/chaingang

ActiveLibrary

ehough/chaingang
================

Chain-of-Responsibility / Chain-of-Command pattern in PHP.

1.0.3(13y ago)46.9k2[1 PRs](https://github.com/ehough/chaingang/pulls)2MPL-2.0PHPPHP &gt;=5.2.0

Since Jul 8Pushed 6y ago2 watchersCompare

[ Source](https://github.com/ehough/chaingang)[ Packagist](https://packagist.org/packages/ehough/chaingang)[ Docs](https://github.com/ehough/chaingang)[ RSS](/packages/ehough-chaingang/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (2)

chaingang
---------

[](#chaingang)

[![Build Status](https://camo.githubusercontent.com/765159100ca8e769f78a81c064eda19ea3e42572e65659afa196f21e61ec7ead/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f65686f7567682f636861696e67616e672e706e67)](http://travis-ci.org/ehough/chaingang)[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://camo.githubusercontent.com/be48b0fc9cc48ea43f28c3fa9b40f1f996876ec42208998c0d372c71c2854167/687474703a2f2f7777772e7265706f7374617475732e6f72672f6261646765732f6c61746573742f6163746976652e737667)](http://www.repostatus.org/#active)[![Latest Stable Version](https://camo.githubusercontent.com/fcd45c46e09f14380366802c632e0dc6a87d59016e327a62b1b0b5387af3f755/68747470733a2f2f706f7365722e707567782e6f72672f65686f7567682f636861696e67616e672f762f737461626c65)](https://packagist.org/packages/ehough/chaingang)[![License](https://camo.githubusercontent.com/a061f12059c1d180ffdedae54cd8227dc7fd6461361cb8ab1a27414717d0827c/68747470733a2f2f706f7365722e707567782e6f72672f65686f7567682f636861696e67616e672f6c6963656e7365)](https://packagist.org/packages/ehough/chaingang)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/558ba7f7d5ee250de18270a30575db721d59d6853b3e26eee8140d20779b86d0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65686f7567682f636861696e67616e672f6261646765732f7175616c6974792d73636f72652e706e673f733d39356365613262393666626462626537346235336639396332623337626332666637316566643330)](https://scrutinizer-ci.com/g/ehough/chaingang/)[![Code Coverage](https://camo.githubusercontent.com/359686e4441fda367216f6f2528834991a52eca1b28d3b0e02d5894bf2c0acc0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65686f7567682f636861696e67616e672f6261646765732f636f7665726167652e706e673f733d30353063663735303332366532313534333066666237666561356562653438346239336162376661)](https://scrutinizer-ci.com/g/ehough/chaingang/)

[Chain-of-Responsibility/Chain-of-Command pattern](http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) for PHP 5.2+

### Sample Usage

[](#sample-usage)

```
/*
 * Build some commands.
 */
$command1 = new MyCommand1();   //implements ehough_chaingang_api_Command
$command2 = new MyCommand2();   //implements ehough_chaingang_api_Command

/*
 * Build and assemble the chain.
 */
$chain = new ehough_chaingang_impl_StandardChain();
$chain->addCommand($command1);
$chain->addCommand($command2);

/*
 * Build the execution context.
 */
$context = new ehough_chaingang_impl_StandardContext();
$context->put('foo', 'bar');

/*
 * Execute the chain.
 */
$successfullyHandled = $chain->execute($context);
```

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

4

Last Release

4789d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.1.0

1.0.3PHP &gt;=5.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/53b269d929f6ba572a15e4b069d9b59e0e99af74db1be60cbac7a56adfea9221?d=identicon)[ehough](/maintainers/ehough)

---

Top Contributors

[![ehough](https://avatars.githubusercontent.com/u/369261?v=4)](https://github.com/ehough "ehough (1 commits)")

### Embed Badge

![Health badge](/badges/ehough-chaingang/health.svg)

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

PHPackages © 2026

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