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

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

ph-7/just-http-status-codes
===========================

Just all HTTP status codes

v1.1.7(1y ago)1447.7k—2.7%24MITPHPPHP &gt;=7.3.0

Since Oct 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pH-7/JustHttpStatusCodes)[ Packagist](https://packagist.org/packages/ph-7/just-http-status-codes)[ Docs](https://pierrehenry.be)[ GitHub Sponsors](https://github.com/pH-7)[ Fund](https://ko-fi.com/phenry)[ RSS](/packages/ph-7-just-http-status-codes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (4)

Just HTTP Status Codes
======================

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

### Empowers your projects with elegant clean practices 💫

[](#empowers-your-projects-with-elegant-clean-practices-)

- [👀 Overview](#-overview)
- [⚙️ PHP Requirement](#-php-requirement)
- [🤩 Usage](#-usage)
- [🧑‍🍳 About](#-who-made-this)
- [📺 Watch How I've Built It](#-building-this-library-together-)
- [✍️ Who I Am](#-who-made-this)
- [⚖️ License](#%EF%B8%8F-license)

📄 Overview
----------

[](#-overview)

**Simplest. Clean. Efficient.** Just what your project needs 🧹

[![Ko Fi - Offer Me A Coffee](media/kofi-logo.png)](https://ko-fi.com/phenry)

Don't hardcode HTTP status codes. Magic numbers (hard-coded numbers) make your code hard to read and understood.

When you have all status codes are stored in readable constants, it makes the development of your application so easy and enjoyable.

It prevents you from using the wrong HTTP status code and saves time and energy when developing an API that involves various HTTP status codes to be sent.

[![PHP HTTP Status Codes constants](media/php-http-status-codes.png)](media/php-http-status-codes.png)

🐘 PHP Requirement
-----------------

[](#-php-requirement)

[PHP v7.3](https://www.php.net/releases/7_3_0.php) or newer 🚀

🛠 Installation
--------------

[](#-installation)

```
composer require ph-7/just-http-status-codes

```

If you don't already use composer in your project, include [Composer's autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading) as below in the main index file, bootstrap or in another file that is always included in all pages.

```
require __DIR__ . '/vendor/autoload.php';
```

🥳 Usage
-------

[](#-usage)

Just use the beautiful HTTP status code you need.

Like below 👇

```
use PH7\JustHttp\StatusCode;

StatusCode::OK; // This is 200

StatusCode::CREATED; // 201 code

StatusCode::NOT_FOUND; // 404

StatusCode::INTERNAL_SERVER_ERROR; // 500
```

💪 Building this library, together! 🚀
------------------------------------

[](#-building-this-library-together-)

[![Watch the video](https://camo.githubusercontent.com/d21def63b3723bb74ce5dd6b03b709e729b5409b35ff9ac47eaa8d9954d32737/68747470733a2f2f69312e7974696d672e636f6d2f76692f664b394b2d55724c484e452f736464656661756c742e6a7067)](https://www.youtube.com/watch?v=fK9K-UrLHNE)

👉 **[Click here to watch on YouTube](https://www.youtube.com/watch?v=fK9K-UrLHNE)**

🧑‍🍳 Who made this...?
---------------------

[](#‍-who-made-this)

[![Pierre-Henry Soria](https://camo.githubusercontent.com/2e624b95003073bd56ecb43792155201b96f2e1d11bab1218e2215b6238c6ac2/68747470733a2f2f732e67726176617461722e636f6d2f6176617461722f61323130666536313235336334336338363964373165616564306539303134393f733d323030)](https://ph7.me "Pierre-Henry Soria personal website")

**[Pierre-Henry Soria](https://ph7.me)**, a highly passionate, zen &amp; pragmatic software engineer 😊

️☕️ Are you enjoying it? **[Offer me a coffee](https://ko-fi.com/phenry)** (what's your favorite coffee? Mine is almond flat white 😋)

[![@phenrysay](https://camo.githubusercontent.com/d4158f0f6ed5d2434d8d9fce9258de955df14fc970066ddb62fe5451f57ab698/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f782d3030303030303f7374796c653d666f722d7468652d6261646765266c6f676f3d78)](https://x.com/phenrysay) [![pH-7](https://camo.githubusercontent.com/4fcd516e2fde608afc9ddd1330de295d23981c27a9b9d695f8abe51f70a1efc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d3130303030303f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](https://github.com/pH-7) [![YouTube Tech Videos](https://camo.githubusercontent.com/6690f404cb91efe3927127c7dae40ed4f401c7d6fbe3ad3635b7ad9ba0b370c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f596f75547562652d4646303030303f7374796c653d666f722d7468652d6261646765266c6f676f3d796f7574756265266c6f676f436f6c6f723d7768697465)](https://www.youtube.com/@pH7Programming "YouTube Tech Channel")

⚖️ License
----------

[](#️-license)

**Just HTTP StatusCodes** is generously distributed under the *[MIT](https://opensource.org/licenses/MIT)* 🎉 Enjoy!

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

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

Every ~123 days

Recently: every ~250 days

Total

10

Last Release

575d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.1.0

v1.1.3PHP &gt;=7.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6d95da236687f1dca4f7d70d60037c70ef217120ea195df23a39a412ba594e0?d=identicon)[ph-7](/maintainers/ph-7)

---

Top Contributors

[![pH-7](https://avatars.githubusercontent.com/u/1325411?v=4)](https://github.com/pH-7 "pH-7 (88 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

clean-codehttphttp-codeshttp-status-codephpphp-status-codestatus-code-constantsstatus-codeshttpcodeclean codeconstantsstatus codehttp-status-codeMagic Numberconstanthttp codePHP status codesall status codesall HTTP status codes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ph-7-just-http-status-codes/health.svg)

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

###  Alternatives

[lmc/http-constants

HTTP Header Fields Constants

25331.3k15](/packages/lmc-http-constants)

PHPackages © 2026

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