perf/http-status

Allows to interact with HTTP status strings to be injected into HTTP headers.

Maintainers

Package info

github.com/jmfeurprier/perf-http-status

pkg:composer/perf/http-status

Statistics

Installs: 4 999

Dependents: 1

Suggesters: 0

Stars: 4

Open Issues: 0

3.1.0 2021-08-17 10:04 UTC

This package is auto-updated.

Last update: 2026-02-15 12:56:09 UTC


README

Allows to interact with HTTP status strings to be injected into HTTP headers.

Installation

composer require perf/http-status

Usage

Concrete calls

<?php

use perf\HttpStatus\HttpStatusRepository;

$repository = HttpStatusRepository::createDefault();

$httpStatus = $repository->get(404);

echo $httpStatus->getReason(); // Will print "Not Found"
echo $httpStatus->toHeader(); //  Will print "HTTP/1.1 404 Not Found"

Static calls

<?php

use perf\HttpStatus\HttpStatusRepository;

$httpStatus = HttpStatusRepository::createDefault()->get(404);

echo $httpStatus->getReason(); // Will print "Not Found"
echo $httpStatus->toHeader(); //  Will print "HTTP/1.1 404 Not Found"