PHPackages                             taluu/chain-of-responsibility-bundle - 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. taluu/chain-of-responsibility-bundle

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

taluu/chain-of-responsibility-bundle
====================================

Bundle allowing to easily implement a chain of responsibility pattern

26.1k[1 issues](https://github.com/Taluu/chain-of-responsibility-bundle/issues)PHP

Since Oct 29Pushed 8y agoCompare

[ Source](https://github.com/Taluu/chain-of-responsibility-bundle)[ Packagist](https://packagist.org/packages/taluu/chain-of-responsibility-bundle)[ RSS](/packages/taluu-chain-of-responsibility-bundle/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Chain of Responsibility Bundle
==============================

[](#chain-of-responsibility-bundle)

A simple bundle that helps to integrate a chain of responsibility pattern through Symfony (3.3 and onwards supported). PHP 7.1 is required.

To install it through composer, you just need to require the `taluu/chain-of-responsibility-bundle` package. Other methods (zip, ... and so on) are supported but you're on your own. :P

Howto
-----

[](#howto)

To declare a chain of responsibility, each items *must* implement the `ChainOfResponsibility\LinkInterface` interface, declaring a successor (if there is one). How the object is executed is your concern. :}

An `AbstractLink` is given if you want to just implement a simple Chain of Responsibility pattern. Just extend it, and just implement the `doHandle` method.

Once you have your chained services, all you have to do is specify them in the bundle's configuration :

```
chain_of_responsibility:
    my_first_chain:
        - foo_service
        - Bar\Baz
        # - ...

    my_second_chain:
        - Bar\Baz
        - baz_service
        # - ...

    # ... and so on
```

The items are services identifiers, so these should be declared.

### Injecting Chains

[](#injecting-chains)

In the case you would want to inject the chains, the tip of each chain is aliased to a `chain_of_responsibility.chains.{{ name }}` (e.g `chain_of_responsibility.chains.my_first_chain`). So use that identifier to inject the correct chain.

Tests
-----

[](#tests)

Tested through PHPUnit 6. So just run the tests and it should be all green. :}

Looking for more ?
------------------

[](#looking-for-more-)

Checks out more information on this design pattern ;

- [https://en.wikipedia.org/wiki/Chain-of-responsibility\_pattern](https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern)
-

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![Taluu](https://avatars.githubusercontent.com/u/239685?v=4)](https://github.com/Taluu "Taluu (18 commits)")

### Embed Badge

![Health badge](/badges/taluu-chain-of-responsibility-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/taluu-chain-of-responsibility-bundle/health.svg)](https://phpackages.com/packages/taluu-chain-of-responsibility-bundle)
```

###  Alternatives

[fntneves/laravel-transactional-events

Transaction-aware Event Dispatcher for Laravel

3202.6M2](/packages/fntneves-laravel-transactional-events)[ipinfo/ipinfo

The official PHP library for IPinfo, the most reliable, accurate, and in-depth source of IP address data available anywhere. We process terabytes of data to produce our custom IP geolocation, company, carrier and IP type data sets. Visit our developer docs at https://ipinfo.io/developers.

2891.2M11](/packages/ipinfo-ipinfo)[typo3/cms-recordlist

TYPO3 CMS Recordlist - Lists database records in the TYPO3 backend module (Web&gt;List).

178.0M48](/packages/typo3-cms-recordlist)[neos/eel

The Embedded Expression Language (Eel) is a building block for creating Domain Specific Languages

122.0M27](/packages/neos-eel)

PHPackages © 2026

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