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(4mo ago)10MITPHPPHP &gt;=7.4

Since Dec 25Pushed 4mo 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 1mo ago

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

30

—

LowBetter than 64% of packages

Maintenance74

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

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

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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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