PHPackages                             colossal/colossal-middleware-queue - 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. colossal/colossal-middleware-queue

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

colossal/colossal-middleware-queue
==================================

A PSR-15 middleware allowing multiple other PSR-15 middleware to be treated as a single entity.

v1.0.2(2y ago)0421MITPHPPHP ^8.0

Since Nov 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/colossalg/Colossal-Middleware-Queue)[ Packagist](https://packagist.org/packages/colossal/colossal-middleware-queue)[ Docs](https://github.com/colossalg/Colossal-Middleware-Queue)[ RSS](/packages/colossal-colossal-middleware-queue/feed)WikiDiscussions main Synced 2w ago

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

Colossal-Middleware-Queue
=========================

[](#colossal-middleware-queue)

A PSR-15 middleware allowing multiple other PSR-15 middleware to be treated as a single entity.

Usage
-----

[](#usage)

```
namespace Dummy;

use Psr\Http\Message\{
    ResponseInterface,
    ServerRequestInterface
};
use Psr\Http\Server\{
    MiddlewareInterface,
    RequestHandlerInterface
};

class DummyMiddlewareA
{
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        echo 'A';
        return $handler->handle($request);
    }
}

class DummyMiddlewareB
{
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        echo 'B';
        return $handler->handle($request);
    }
}

class DummyHandler
{
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        echo 'Handler';
        // Return a ResponseInterface
    }
}

```

```
// ---------------------------------------------------------------------------- //
// Creating and using the MiddlewareQueue is trivial.                           //
// ---------------------------------------------------------------------------- //

use Colossal\MiddlewareQueue\MiddlewareQueue;
use Dummy\{
    DummyMiddlewareA,
    DummyMiddlewareB,
    DummyHandler
};

$dummyMiddlewareA = new DummyMiddlewareA();
$dummyMiddlewareB = new DummyMiddlewareB();

$middlewareQueue = new MiddlewareQueue();
$middlewareQueue->enqueue($dummyMiddlewareA);
$middlewareQueue->enqueue($dummyMiddlewareB);

// ---------------------------------------------------------------------------- //
// The resulting MiddlewareQueue can now be used as a single middleware.        //
// A call to process will now do the following (in order):                      //
//   - Call $dummyMiddlewareA->process() passing the request passed to          //
//     $middlewareQueue->process().                                             //
//   - Call $dummyMiddlewareB->process() passing the request passed to          //
//     $middlewareQueue->process().                                             //
//   - Call RequestHandlerInterface::handle() on the handler passed to          //
//     $middlewareInterface->process().                                         //
// ---------------------------------------------------------------------------- //

$middlewareQueue->process($request, $dummyHandler);
// Prints:
// A
// B
// Handler
```

Development Tips
----------------

[](#development-tips)

### Running PHPStan Code Quality Analysis

[](#running-phpstan-code-quality-analysis)

Run the PHPStan code quality analysis with the following command:

```
>> .\vendor\bin\phpstan --configuration=phpstan.neon
```

### Running PHP Code Sniffer Code Style Analysis

[](#running-php-code-sniffer-code-style-analysis)

Run the PHP Code Sniffer code style analysis with the following commands:

```
>> .\vendor\bin\phpcs --standard=phpcs.xml src
```

To fix automatically resolve issues found by PHP Code Sniffer run the following commands:

```
>> .\vendor\bin\phpcbf --standard=phpcs.xml src
```

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

1016d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d2a935d24a37f2255e4aba33f327f6d9f9e91b1063ffcd3a51ce46ea841dd58?d=identicon)[colossalg](/maintainers/colossalg)

---

Top Contributors

[![colossalg](https://avatars.githubusercontent.com/u/39691679?v=4)](https://github.com/colossalg "colossalg (6 commits)")

---

Tags

middlewarepsr-15

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/colossal-colossal-middleware-queue/health.svg)

```
[![Health](https://phpackages.com/badges/colossal-colossal-middleware-queue/health.svg)](https://phpackages.com/packages/colossal-colossal-middleware-queue)
```

###  Alternatives

[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.6k2.2M144](/packages/mcp-sdk)[cakephp/authentication

Authentication plugin for CakePHP

1214.3M118](/packages/cakephp-authentication)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73151.3k35](/packages/jaxon-php-jaxon-core)[flarum/core

Delightfully simple forum software.

211.5M2.5k](/packages/flarum-core)[xima/xima-typo3-frontend-edit

Frontend Edit - This extension provides an edit button for editors within frontend content elements.

1615.6k](/packages/xima-xima-typo3-frontend-edit)[sunrise/http-router

A powerful solution as the foundation of your project.

16852.3k12](/packages/sunrise-http-router)

PHPackages © 2026

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