PHPackages                             asgrim/random-status-code-middleware - 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. asgrim/random-status-code-middleware

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

asgrim/random-status-code-middleware
====================================

Middleware to set a random status code

0.0.1(6y ago)611[1 PRs](https://github.com/asgrim/random-status-middleware/pulls)MITPHPPHP &gt;=7.3.0,&lt;7.4.0

Since Jun 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/asgrim/random-status-middleware)[ Packagist](https://packagist.org/packages/asgrim/random-status-code-middleware)[ RSS](/packages/asgrim-random-status-code-middleware/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Random Status Middleware
========================

[](#random-status-middleware)

Randomise the status code returned from a middleware pipeline.

[![CircleCI](https://camo.githubusercontent.com/816e9c3c65a624fe7b22d7f02145273ca155f5d719537e6fcca1a880e3f47079/68747470733a2f2f636972636c6563692e636f6d2f67682f61736772696d2f72616e646f6d2d7374617475732d6d6964646c65776172652e7376673f7374796c653d737667)](https://circleci.com/gh/asgrim/random-status-middleware)

Given a middleware pipeline, change the HTTP status code to a new random status code.

Inspired by my own tweet:

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

[](#installation)

- `composer require asgrim/random-status-middleware`

Usage
-----

[](#usage)

Add `\Asgrim\RandomStatusMiddleware\RandomStatusMiddleware` into your middleware pipeline. Probably works best towards the outermost layer to ensure the status code is not overwritten unintentionally by another middleware.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

2516d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2734194006e4987a8e12379a63b4f6c0a4478b5818ea7ce677499b1f714a92d2?d=identicon)[asgrim](/maintainers/asgrim)

---

Top Contributors

[![asgrim](https://avatars.githubusercontent.com/u/496145?v=4)](https://github.com/asgrim "asgrim (5 commits)")[![BinaryKitten](https://avatars.githubusercontent.com/u/67553?v=4)](https://github.com/BinaryKitten "BinaryKitten (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/asgrim-random-status-code-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/asgrim-random-status-code-middleware/health.svg)](https://phpackages.com/packages/asgrim-random-status-code-middleware)
```

###  Alternatives

[jaxon-php/jaxon-core

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

73142.3k25](/packages/jaxon-php-jaxon-core)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[fisharebest/webtrees

webtrees online genealogy

73710.5k13](/packages/fisharebest-webtrees)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[eliashaeussler/typo3-solver

Extension for TYPO3 CMS to extend TYPO3's exception handling with AI generated solutions

292.1k](/packages/eliashaeussler-typo3-solver)

PHPackages © 2026

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