PHPackages                             willy68/pg-middleware-stack - 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. willy68/pg-middleware-stack

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

willy68/pg-middleware-stack
===========================

A simple middleware stack

0.1.2(10mo ago)02123MITPHPPHP ~8.1 || ~8.2 || ~8.3 || ~8.4

Since Jul 27Pushed 10mo agoCompare

[ Source](https://github.com/willy68/pg-middleware-stack)[ Packagist](https://packagist.org/packages/willy68/pg-middleware-stack)[ RSS](/packages/willy68-pg-middleware-stack/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (6)Versions (5)Used By (3)

pg-middleware-stack
===================

[](#pg-middleware-stack)

Gestion de pile de middlewares PSR-15 pour PHP.

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

[](#installation)

Utilisez Composer pour installer le package :

```
composer require votre-vendor/pg-middleware-stack
```

Utilisation
-----------

[](#utilisation)

Incluez le trait `MiddlewareAwareStackTrait` dans votre classe pour gérer une pile de middlewares :

```
use Pg\Middleware\Stack\MiddlewareAwareStackTrait;

class MyMiddlewareStack
{
    use MiddlewareAwareStackTrait;
}
```

### Ajouter des middlewares

[](#ajouter-des-middlewares)

```
$stack = new MyMiddlewareStack();
$stack->middleware($monMiddleware);
$stack->middlewares([$middleware1, $middleware2]);
$stack->prependMiddleware($middlewarePrioritaire);
```

### Récupérer et exécuter un middleware

[](#récupérer-et-exécuter-un-middleware)

```
$middleware = $stack->shiftMiddleware($container);
if ($middleware) {
    // Exécuter le middleware
}
```

API
---

[](#api)

- `middleware($middleware)` : Ajoute un middleware à la fin de la pile.
- `middlewares(array $middlewares)` : Ajoute plusieurs middlewares.
- `prependMiddleware($middleware)` : Ajoute un middleware au début de la pile.
- `shiftMiddleware(ContainerInterface $c)` : Retire et retourne le premier middleware.
- `getMiddlewareStack()` : Retourne la pile actuelle.

Licence
-------

[](#licence)

MIT

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance54

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

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

Total

4

Last Release

315d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ee0f14e65474268155360744e058f5a000e5d865d1e07211241554d89f792a5?d=identicon)[willy68](/maintainers/willy68)

---

Top Contributors

[![willy68](https://avatars.githubusercontent.com/u/34144331?v=4)](https://github.com/willy68 "willy68 (10 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/willy68-pg-middleware-stack/health.svg)

```
[![Health](https://phpackages.com/badges/willy68-pg-middleware-stack/health.svg)](https://phpackages.com/packages/willy68-pg-middleware-stack)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.5k1.5M88](/packages/mcp-sdk)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)

PHPackages © 2026

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