Just HTTP Status Codes is a great way to empower your project with clean practice πŸ’«

Overview

Just HTTP StatusCodes

Just HTTP Status Codes is a great way to empower your project with clean practice πŸ’«

πŸ“„ Description

Don't hardcode HTTP status codes. Magic numbers (hard-coded numbers) make your code hard to be 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 of 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 Requirement

[PHP v7.1](https://www.php.net/releases/7_1_0.php) or newer.

πŸ›  Installation

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

Then, if you don't already use composer in your project, include Composer's autoload as below in the index, bootstrap or another file that are included everywhere when you project is running

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

πŸ₯³ 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

πŸ˜‹ Who cooked it?

Pierre-Henry Soria

@phenrysay pH-7

Pierre-Henry Soria, a highly passionate, zen & pragmatic software engineer 😊

βš–οΈ License

Just HTTP StatusCodes is generously distributed under the MIT.

You might also like...
HTTPlug, the HTTP client abstraction for PHP

HTTPlug HTTPlug, the HTTP client abstraction for PHP. Intro HTTP client standard built on PSR-7 HTTP messages. The HTTPlug client interface is compati

PSR-7 HTTP Message implementation

zend-diactoros Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-diactoros. Master: Develop: Diactoros (pronunciation: /dΙͺʌ

The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously.

HttpClient component The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously. Resources Documentati

PSR HTTP Message implementations

laminas-diactoros Diactoros (pronunciation: /dΙͺʌktΙ’rΙ’s/): an epithet for Hermes, meaning literally, "the messenger." This package supercedes and repla

Unirest in PHP: Simplified, lightweight HTTP client library.

Unirest for PHP Unirest is a set of lightweight HTTP libraries available in multiple languages, built and maintained by Mashape, who also maintain the

PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs

PHP Curl Class: HTTP requests made easy PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. Installation Requirements Quic

The HttpFoundation component defines an object-oriented layer for the HTTP specification.

HttpFoundation Component The HttpFoundation component defines an object-oriented layer for the HTTP specification. Resources Documentation Contributin

HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7

HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7 Installation composer require sunrise/http-header-kit How to use? HTTP Header Collection Mor

β†ͺ️ Bypass for PHP creates a custom HTTP Server to return predefined responses to client requests
β†ͺ️ Bypass for PHP creates a custom HTTP Server to return predefined responses to client requests

Bypass for PHP provides a quick way to create a custom HTTP Server to return predefined responses to client requests.Useful for tests with Pest PHP or PHPUnit.

Comments
  • Resolves issue#1

    Resolves issue#1

    Changed log

    • Closes #1.
    • I also notice that this package uses the PHPUnit ^9 and it also requires php-7.3 version at least.
    • It's time to drop php-7.1 and php-7.2 version support because they're outdated and it can also fix above issue :).
    • This GitHub workflow action is available on my forked repository.
    opened by peter279k 1
Releases(v1.1.5)
Owner
β™š PH⑦ de Soriaβ„’β™›
βš‘οΈπ™€π™£π™©π™π™ͺπ™¨π™žπ™–π™¨π™©π™žπ™˜ & π™‹π™–π™¨π™¨π™žπ™€π™£π™–π™©π™š π˜Ώπ™šπ™« 🎈Everyday-learning, coding, eating fruits & doing sport are my fuel! πŸš€ Enjoy 80/20 and Parkinson's πŸ€–
β™š PH⑦ de Soriaβ„’β™›
The Library for HTTP Status Codes, Messages and Exception

This is a PHP library for HTTP status codes, messages and error exception. Within the library, HTTP status codes are available in classes based on the section they belong to. Click this link for more information.

Sabuhi Alizada 5 Sep 14, 2022
Declarative HTTP Clients using Guzzle HTTP Library and PHP 8 Attributes

Waffler How to install? $ composer require waffler/waffler This package requires PHP 8 or above. How to test? $ composer phpunit Quick start For our e

Waffler 3 Aug 26, 2022
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

null 3.5k Dec 31, 2022
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

This is a port of the VCR Ruby library to PHP. Record your test suite's HTTP interactions and replay them during future test runs for fast, determinis

php-vcr 1.1k Dec 23, 2022
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

null 3.5k Dec 31, 2022
This package provides the database factory experience to fake Http calls in your testsuite.

This package provides the database factory experience to fake Http calls in your testsuite

DIJ 11 May 2, 2022
Opsie Operator is a CLI to check your website for HTTP downtime.

Opsie Operator Monitor any website. Run in Docker or any Kubernetes cluster. Send webhooks. ?? Supporting If you are using one or more Renoki Co. open

opsie 14 Dec 6, 2021
Guzzle, an extensible PHP HTTP client

Guzzle, PHP HTTP client Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interf

Guzzle 22.3k Jan 2, 2023
A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.

Httpful Httpful is a simple Http Client library for PHP 7.2+. There is an emphasis of readability, simplicity, and flexibility – basically provide the

Nate Good 1.7k Dec 21, 2022
PHP's lightweight HTTP client

Buzz - Scripted HTTP browser Buzz is a lightweight (<1000 lines of code) PHP 7.1 library for issuing HTTP requests. The library includes three clients

Kris Wallsmith 1.9k Jan 4, 2023