PHPackages                             hyqo/http-codes - 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. hyqo/http-codes

ActiveLibrary

hyqo/http-codes
===============

1.0.0(3y ago)047↓100%MITPHPPHP ^8.2

Since Mar 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hyqo/http-codes)[ Packagist](https://packagist.org/packages/hyqo/http-codes)[ RSS](/packages/hyqo-http-codes/feed)WikiDiscussions main Synced today

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

HTTP status codes
=================

[](#http-status-codes)

[![Packagist Version](https://camo.githubusercontent.com/008951bb754f673a49d82fef3f92e8058a0a68c2c5eaef20f2d5958607447c35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6879716f2f687474702d636f6465733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/008951bb754f673a49d82fef3f92e8058a0a68c2c5eaef20f2d5958607447c35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6879716f2f687474702d636f6465733f7374796c653d666c61742d737175617265)[![Packagist PHP Version Support](https://camo.githubusercontent.com/40359f222b660b98edffd257922185dcfadedd23f3a7d64e6581efb29caff8d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6879716f2f687474702d636f6465733f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/40359f222b660b98edffd257922185dcfadedd23f3a7d64e6581efb29caff8d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6879716f2f687474702d636f6465733f7374796c653d666c61742d737175617265)[![GitHub Workflow Status](https://camo.githubusercontent.com/8391f7374463571825cb4dda80a8e99b09bca176887277b483ebc91a3ed2d480/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6879716f2f687474702d636f6465732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/8391f7374463571825cb4dda80a8e99b09bca176887277b483ebc91a3ed2d480/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6879716f2f687474702d636f6465732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)

Install
-------

[](#install)

```
composer require hyqo/http-codes
```

Usage
-----

[](#usage)

```
use Hyqo\Http\HttpCode;

echo HttpCode::OK->header(); //HTTP/1.0 200 OK
echo HttpCode::OK->header(1.1); //HTTP/1.1 200 OK
echo HttpCode::OK->header('http/1.1')); //HTTP/1.1 200 OK
```

`$_SERVER['SERVER_PROTOCOL']` is respectful and is used by default when creating a header string

```
use Hyqo\Http\HttpCode;

echo HttpCode::OK->header(); //HTTP/1.0 200 OK

$_SERVER['SERVER_PROTOCOL'] = "HTTP/1.1"
echo HttpCode::OK->header(); //HTTP/1.1 200 OK
```

`message()` and `version()` methods also available

```
echo HttpCode::NOT_FOUND->message(); //Not Found
echo HttpCode::NOT_FOUND->version(); //1
```

It's a Backed Enum with `int` codes

```
HttpCode::IM_A_TEAPOT->value; //(int) 418
HttpCode::from(418)->message(); //(string) "I'm a teapot"
```

### Supported codes

[](#supported-codes)

See [https://en.wikipedia.org/wiki/List\_of\_HTTP\_status\_codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)

#### 1xx informational response

[](#1xx-informational-response)

CodeMessage100Continue101Switching Protocols102Processing103Early Hints#### 2xx success

[](#2xx-success)

CodeMessage200OK201Created202Accepted203Non-Authoritative Information204No Content205Reset Content206Partial Content207Multi Status208Already Reported226IM Used#### 3xx redirection

[](#3xx-redirection)

CodeMessage300Multiple Choices301Moved Permanently302Found303See Other304Not Modified305Use Proxy306Switch Proxy307Temporary Redirect308Permanent Redirect#### 4xx client errors

[](#4xx-client-errors)

CodeMessage400Bad Request401Unauthorized402Payment Required403Forbidden404Not Found405Method Not Allowed406Not Acceptable407Proxy Authentication Required408Request Timeout409Conflict410Gone411Length Required412Precondition Failed413Payload Too Large414URI Too Long415Unsupported Media Type416Range Not Satisfiable417Expectation Failed418I'm a teapot421Misdirected Request422Unprocessable Entity423Locked424Failed Dependency425Too Early426Upgrade Required428Precondition Required429Too Many Requests431Request Header Fields Too Large451Unavailable For Legal Reasons#### 5xx server errors

[](#5xx-server-errors)

CodeMessage500Internal Server Error501Not Implemented502Bad Gateway503Service Unavailable504Gateway Timeout505HTTP Version Not Supported506Variant Also Negotiates507Insufficient Storage508Loop Detected510Not Extended511Network Authentication Required

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Unknown

Total

1

Last Release

1114d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4230413a88525a7581fb391836718bcca27b8d1698f97b61de0dd6d816fac41?d=identicon)[akeylimepie](/maintainers/akeylimepie)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hyqo-http-codes/health.svg)

```
[![Health](https://phpackages.com/badges/hyqo-http-codes/health.svg)](https://phpackages.com/packages/hyqo-http-codes)
```

PHPackages © 2026

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