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

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

rayanlevert/http
================

PHP enumerations for HTTP codes and methods

v1.0.0(2y ago)06BSD-3-ClausePHPPHP &gt;=8.1

Since May 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rayanlevert/http)[ Packagist](https://packagist.org/packages/rayanlevert/http)[ RSS](/packages/rayanlevert-http/feed)WikiDiscussions main Synced 1mo ago

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

Simple functionalites handling HTTP (codes and methods) via PHP enumerations (from 8.1)
---------------------------------------------------------------------------------------

[](#simple-functionalites-handling-http-codes-and-methods-via-php-enumerations-from-81)

[![Packagist Version](https://camo.githubusercontent.com/89d85c0b06488217b43f5cc323a2657fff3bf80eb42e9da211d5069d949ff757/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726179616e6c65766572742f68747470)](https://packagist.org/packages/rayanlevert/http)[![PHP from Packagist](https://camo.githubusercontent.com/fd54b9496e2f34fae6c691f49366216658b18d4966401495547e6e20fcaaa8d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f726179616e6c65766572742f68747470)](https://packagist.org/packages/rayanlevert/http)[![codecov](https://camo.githubusercontent.com/20698852b42584e99f0f9810ea601def7e7e3ca25ff8c7ca81e96f81dff017a4/68747470733a2f2f636f6465636f762e696f2f67682f726179616e6c65766572742f687474702f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/rayanlevert/http)

> Refer to php-fig

### RayanLevert\\Http\\Codes

[](#rayanleverthttpcodes)

PHP enumeration with HTTP codes [RayanLevert\\Http\\Codes](src/Codes.php)

### DisDev\\Http\\Methods

[](#disdevhttpmethods)

PHP enumeration with HTTP methods

```
enum Methods: string
{
    case HEAD    = 'HEAD';
    case GET     = 'GET';
    case POST    = 'POST';
    case PUT     = 'PUT';
    case PATCH   = 'PATCH';
    case DELETE  = 'DELETE';
    case PURGE   = 'PURGE';
    case OPTIONS = 'OPTIONS';
    case TRACE   = 'TRACE';
    case CONNECT = 'CONNECT';
}

\RayanLevert\Http\Methods::HEAD // 'HEAD'
```

### RayanLevert\\Http\\Exception

[](#rayanleverthttpexception)

PHP exception initialized with an HTTP code with `RayanLevert\Http\Codes`

```
// HTTP 401 error
$oException = new \RayanLevert\Http\Exception('Unauthorized', \RayanLevert\Http\Codes::CLIENT_UNAUTHORIZED)
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

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

745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7253402d616a4792e6733113363a7f6918d318fb2b68fce60e5eb6d715319d69?d=identicon)[rayanlevert](/maintainers/rayanlevert)

---

Top Contributors

[![rayanlevert](https://avatars.githubusercontent.com/u/78140431?v=4)](https://github.com/rayanlevert "rayanlevert (11 commits)")[![rlevert-dis](https://avatars.githubusercontent.com/u/83226311?v=4)](https://github.com/rlevert-dis "rlevert-dis (4 commits)")

---

Tags

enumerationhttp-codehttp-methodphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  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)
