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(7y ago)611[1 PRs](https://github.com/asgrim/random-status-middleware/pulls)MITPHPPHP &gt;=7.3.0,&lt;7.4.0

Since Jun 26Pushed 7y 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 3w 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 26% 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

2563d 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

[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.5M83](/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)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[cakephp/authentication

Authentication plugin for CakePHP

1214.1M101](/packages/cakephp-authentication)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.0k](/packages/typo3-cms-core)

PHPackages © 2026

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