PHPackages                             nathansalter/decision-pipeline - 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. nathansalter/decision-pipeline

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

nathansalter/decision-pipeline
==============================

Simple Middleware-type method of making decisions

0.1.0(10y ago)515MITPHPPHP ^5.5 || ^7.0

Since May 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/nathansalter/decision-pipeline)[ Packagist](https://packagist.org/packages/nathansalter/decision-pipeline)[ RSS](/packages/nathansalter-decision-pipeline/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

decision-pipeline
=================

[](#decision-pipeline)

Middleware-esque way of making decisions instead of using Event Managers

Usage
-----

[](#usage)

Usage of this is very simple. Providing the pipeline a question object, to decide on will pass this question through to all of the decision actors (deciders). Each decider in turn chooses to either make an ultimate decision or make a decision which may be overridden at a later stage.

Example
-------

[](#example)

Preferable usage is to create your own Question and Decision classes, but if using PHP7 then you MAY use anonymous classes. Deciders passed into the Pipeline MUST either implement PipelineDecider or be a closure.

```
$pipeline = new DecisionPipeline([
    function (Question $question, Decision $decision, callable $next = null) {
        if($question->cannot()) {
            throw new \RuntimeException('I cannot!');
        }
        return $next($question, $decision);
    },
    new SpecialDecider()
]);
$decision = $pipeline->decide(new SpecialQuestion());

```

If no decision is made, the NoDecision class will be returned. You MAY return a custom default decision by simply passing it in as the second parameter to the constructor.

```
$pipeline = new DecisionPipeline([], new SpecialDefaultDecision());

```

Each decider is ALWAYS run in order that it is passed into the constructor, so any priority MUST be set in the constructor.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

3684d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/998690?v=4)[Nathan Salter](/maintainers/nathansalter)[@nathansalter](https://github.com/nathansalter)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nathansalter-decision-pipeline/health.svg)

```
[![Health](https://phpackages.com/badges/nathansalter-decision-pipeline/health.svg)](https://phpackages.com/packages/nathansalter-decision-pipeline)
```

###  Alternatives

[gongo/merciful-polluter

Emulate `register\_globals` and `magic\_quotes\_gpc` in PHP 5.4 or higher

1715.8k](/packages/gongo-merciful-polluter)

PHPackages © 2026

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