PHPackages                             symbid/chainlink - 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. symbid/chainlink

Abandoned → [dms/chainlink](/?search=dms%2Fchainlink)Library[Utility &amp; Helpers](/categories/utility)

symbid/chainlink
================

Chainlink offers a drop in implementation of the Chain of Responsibility implementation.

v0.4(9y ago)51722[5 PRs](https://github.com/rdohms/chainlink/pulls)1MITPHPPHP &gt;=5.4.0

Since Feb 13Pushed 5y ago4 watchersCompare

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

READMEChangelog (4)Dependencies (3)Versions (10)Used By (1)

DMS Chainlink
=============

[](#dms-chainlink)

[![Latest Version](https://camo.githubusercontent.com/8b2169bfd0eb45544b853ebff9c4a51ab8aff5a868a687f5757ac1c7881f894f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f72646f686d732f636861696e6c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/rdohms/chainlink/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2dd45235338346c6da9d1cb13a30cbdd771bbc523e5a571e460d87902cda8333/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72646f686d732f636861696e6c696e6b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rdohms/chainlink)[![Coverage Status](https://camo.githubusercontent.com/1a3c3cbe80eebcdbe7a1a71b6211399b52df448b5dec84429e6c029a91fbb057/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f72646f686d732f636861696e6c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rdohms/chainlink/code-structure)[![Quality Score](https://camo.githubusercontent.com/0fa15d2d9a490e0f1d1d43fd49093ea1436da3d5edd2d901162bcf274e30d380/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72646f686d732f636861696e6c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rdohms/chainlink)[![Total Downloads](https://camo.githubusercontent.com/1b3f9ffe55bff06fb3f78bf2dc5fb6b1f83e8ae0727e27f7dcbe612e8fb0608b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72646f686d732f636861696e6c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rdohms/chainlink)

Chainlink is a drop in implementation of the Chain of Responsibility pattern. Its a very simple library that helps you avoid boiler plate code in order to provide a chain of responsibility to handle a particular task.

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

[](#installation)

Chainlink library has been split so that the Context, the class that implements the chain is isolated in this library and adapters and wrapper for popular frameworks are available in separate packages.

If you only need the chain implementation, get chainlink by running:

```
composer require dms/chainlink
```

If you use Symfony or other frameworks, check [Packagist](http://packagist.org/packages/dms/) for wrappers and adapters.

Usage
-----

[](#usage)

To use chainlink, all you need to do is implement the `HandlerInterface` on your handlers and register them with a context.

```
class MyHandler implements HandlerInterface
{
    // ... fulfill interface ...
}

$handler = new MyHandler();

// Create a Context to chain responsibilities
$context = new DMS\Chainlink\Context();
$context->addHandler($handler);

// Pass in an item to be handled
$context->handle($input);

// You can also get the handler as a return value
$handler = $context->getHandlerFor($input);

// You may have need of returning multiple handlers
$handler = $context->getAllHandlersFor($input);
```

Its the handler's responsibility to identify which input it is responsible for, the interface contains a `handles` method that is called for that.

Order of Chain handling
-----------------------

[](#order-of-chain-handling)

Sometimes it's useful to influence which handler gets called first. `addHandler` supports an optional second parameter with a priority integer. The highest number in the chain will be called first.

```
// Create a Context to chain responsibilities
$context = new DMS\Chainlink\Context();
$context->addHandler($handler1, 10);
$context->addHandler($handler2, 1000);
$context->addHandler($handler3);

// Pass in an item to be handled
$context->handle($input);
```

The following handlers will be called in order (provided they can handle the usecase) `$handler2 -> $handler1 -> $handler3`

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~177 days

Total

4

Last Release

3581d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23a593969f579439fd872c91e475453dc72d08aaa98e14d759ac0b8ab707e3bd?d=identicon)[rdohms](/maintainers/rdohms)

---

Top Contributors

[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (22 commits)")[![frankdejonge](https://avatars.githubusercontent.com/u/534693?v=4)](https://github.com/frankdejonge "frankdejonge (1 commits)")[![jeroenvdgulik](https://avatars.githubusercontent.com/u/242090?v=4)](https://github.com/jeroenvdgulik "jeroenvdgulik (1 commits)")

---

Tags

handlerdmschain of responsibility

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/symbid-chainlink/health.svg)

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

###  Alternatives

[data-values/geo

Geographical value objects, parsers and formatters

20631.0k18](/packages/data-values-geo)

PHPackages © 2026

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