PHPackages                             saboohy/httpstatus - 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. saboohy/httpstatus

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

saboohy/httpstatus
==================

The Library for HTTP Status Codes, Messages and Exception

v3.0.0(2y ago)51.2k↓85%MITPHPPHP &gt;=8.1

Since Jul 24Pushed 2y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (21)Used By (0)

HttpStatus
==========

[](#httpstatus)

This is a PHP library for HTTP status codes, messages and error exceptions.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

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

[](#installation)

You can install the package via composer:

```
composer require saboohy/httpstatus
```

Usage
-----

[](#usage)

```
use Saboohy\HttpStatus\Success;

echo Success::OK->value;
echo Success::OK->message();
```

Enums
-----

[](#enums)

There are 5 enum objects in this library. **Info**, **Success**, **Redirect**, **Client** and **Server**.

### Informational Responses (1xx)

[](#informational-responses-1xx)

Cases for informational responses are organized inside of **Info** enum.

CaseCodeCONTINUE100SWITCHING\_PROTOCOLS101PROCESSING102EARLY\_HINTS103#### Usage

[](#usage-1)

```
use Saboohy\HttpStatus\Info;

echo Info::CONTINUE->value;
```

### Successful Responses (2xx)

[](#successful-responses-2xx)

Successful responses are organized inside of **Success** enum.

CaseCodeOK200CREATED201ACCEPTED202NON\_AUTHORITATIVE\_INFORMATION203NO\_CONTENT204RESET\_CONTENT205PARTIAL\_CONTENT206MULTI\_STATUS207ALREADY\_REPORTED208IM\_USED226#### Usage

[](#usage-2)

```
use Saboohy\HttpStatus\Success;

echo Success::OK->value;
```

### Redirection Messages (3xx)

[](#redirection-messages-3xx)

Redirect responses are organized inside of **Redirect** enum.

CaseCodeMULTIPLE\_CHOICES300MOVED\_PERMANENTLY301FOUND302SEE\_OTHER303NOT\_MODIFIED304TEMPORARY\_REDIRECT307PERMANENT\_REDIRECT308#### Usage

[](#usage-3)

```
use Saboohy\HttpStatus\Redirect;

echo Redirect::MULTIPLE_CHOICES->value;
```

### Client Error Responses (4xx)

[](#client-error-responses-4xx)

Cases for client error responses are organized inside of **Client** enum.

CaseCodeBAD\_REQUEST400UNAUTHORIZED401FORBIDDEN403NOT\_FOUND404METHOD\_NOT\_ALLOWED405NOT\_ACCEPTABLE406PROXY\_AUTHENTICATION\_REQUIRED407REQUEST\_TIMEOUT408CONFLICT409GONE410LENGTH\_REQUIRED411PRECONDITION\_FAILED412PAYLOAD\_TOO\_LARGE413URI\_TOO\_LONG414UNSUPPORTED\_MEDIA\_TYPE415RANGE\_NOT\_SATISFIABLE416EXPECTATION\_FAILED417IM\_A\_TEAPOT418MISDIRECTED\_REQUEST421UNPROCESSABLE\_ENTITY422LOCKED423FAILED\_DEPENDENCY424TOO\_EARLY425UPGRADE\_REQUIRED426PRECONDITION\_REQUIRED428TOO\_MANY\_REQUESTS429REQUEST\_HEADER\_FIELDS\_TOO\_LARGE431UNAVAILABLE\_FOR\_LEGAL\_REASONS451CLIENT\_CLOSED\_REQUEST499#### Usage

[](#usage-4)

```
use Saboohy\HttpStatus\Client;

echo Client::BAD_REQUEST->value;
```

### Server Error Responses (5xx)

[](#server-error-responses-5xx)

Cases for server error responses are organized inside of **Server** enum.

CaseCodeINTERNAL\_SERVER\_ERROR500NOT\_IMPLEMENTED501BAD\_GATEWAY502SERVICE\_UNAVAILABLE503GATEWAY\_TIMEOUT504HTTP\_VERSION\_NOT\_SUPPORTED505VARIANT\_ALSO\_NEGOTIATES506INSUFFICIENT\_STORAGE507LOOP\_DETECTED508NOT\_EXTENDED510NETWORK\_AUTHENTICATION\_REQUIRED511NETWORK\_READ\_TIMEOUT\_ERROR598NETWORK\_CONNECT\_TIMEOUT\_ERROR599#### Usage

[](#usage-5)

```
use Saboohy\HttpStatus\Server;

echo Server::INTERNAL_SERVER_ERROR->value;
```

HttpErrorException
------------------

[](#httperrorexception)

This class is used for error exceptions. The "constructor" method of this class must receive a case of enum. Remember that the value you will give must be of type 4xx and 5xx.

### Usage

[](#usage-6)

```
use Saboohy\HttpStatus\Client;
use Saboohy\HttpStatus\HttpErrorException;

throw new HttpErrorException(Client::BAD_REQUEST);
```

License
-------

[](#license)

The MIT License (MIT). Please, look at [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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

Every ~21 days

Recently: every ~95 days

Total

20

Last Release

933d ago

Major Versions

v1.3.0 → v2.0.02022-08-01

v2.3.2 → v3.0.02023-09-01

PHP version history (3 changes)v1.0.0PHP &gt;=8.0

v1.2.1PHP &gt;=7.4

v3.0.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

httpphpcodeheaderstatus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saboohy-httpstatus/health.svg)

```
[![Health](https://phpackages.com/badges/saboohy-httpstatus/health.svg)](https://phpackages.com/packages/saboohy-httpstatus)
```

PHPackages © 2026

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