Skip to content

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

License

Notifications You must be signed in to change notification settings

jmfeurprier/perf-http-status

Repository files navigation

perf HTTP status

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"

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages