logiek/http-status-codes

Constants enumerating the HTTP Status Codes. Based on the HTTP Status Code Registry.

1.4.0 2023-08-10 17:15 UTC

This package is auto-updated.

Last update: 2024-11-10 20:21:26 UTC


README

Latest Stable Version Total Downloads License PHP Version Require

Constants enumerating the HTTP Status Codes. Based on the HTTP Status Code Registry.

Installation

You can install the package via Composer:

composer require logiek/http-status-codes

Usage

use Logiek\Http\StatusCode;

StatusCode::HTTP_OK; // 200
StatusCode::get(); // [100 => 'Continue', 101 => 'Switching Protocols', ...]
StatusCode::getReasonPhrase(StatusCode::HTTP_OK); // OK
StatusCode::getStatusCode('Not Found'); // 404

Changelog

Please see the CHANGELOG for more information about recent changes.

Testing

Run the tests with:

composer test

License

This project is open-sourced software licensed under the MIT license.