PHPackages                             akashjoshi1999/http-status-code - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. akashjoshi1999/http-status-code

ActiveLibrary[HTTP &amp; Networking](/categories/http)

akashjoshi1999/http-status-code
===============================

HTTP status code constants and helpers for PHP (Composer package)

v1.0(6mo ago)10MITPHPPHP &gt;=7.4

Since Dec 25Pushed 6mo agoCompare

[ Source](https://github.com/akashjoshi1999/http-status-code)[ Packagist](https://packagist.org/packages/akashjoshi1999/http-status-code)[ RSS](/packages/akashjoshi1999-http-status-code/feed)WikiDiscussions master Synced today

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

HTTP Status Codes (Composer)
============================

[](#http-status-codes-composer)

This lightweight PHP package provides named constants and helper methods for HTTP status codes so developers can use meaningful constant names instead of raw integers.

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

[](#installation)

Add to your project using Composer (once published):

```
composer require akashjoshi1999/http-status-code
```

Or include locally via `composer.json` PSR-4 autoload.

Usage
-----

[](#usage)

```
use HttpStatusCode\HttpStatus;

// Use named constant instead of literal number
$status = HttpStatus::OK; // 200

// Get reason phrase
$phrase = HttpStatus::reasonPhrase($status); // 'OK'

// Get constant name from code
$name = HttpStatus::constantName(404); // 'NOT_FOUND'

// List all codes
$all = HttpStatus::all();
```

Files
-----

[](#files)

- `src/HttpStatus.php` — constants and helpers
- `examples/example.php` — small usage example

Contributing
------------

[](#contributing)

Contributions welcome. Add more codes or helper utilities as needed.

Running tests
-------------

[](#running-tests)

Run the project's tests locally (after cloning/installing dependencies):

```
composer install
composer test
# or directly with PHPUnit:
php vendor/bin/phpunit --configuration phpunit.xml
```

Expected output (example):

```
OK (4 tests, 12 assertions)

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance68

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

190d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5090032a729a203a807fcdb669eb4e47ffc9d2d02610e2e4d2122e6f3937cbb3?d=identicon)[a\_k\_a\_s\_h\_joshi](/maintainers/a_k_a_s_h_joshi)

---

Top Contributors

[![akashjoshi1999](https://avatars.githubusercontent.com/u/38850663?v=4)](https://github.com/akashjoshi1999 "akashjoshi1999 (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/akashjoshi1999-http-status-code/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M91](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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