Allows to interact with HTTP status strings to be injected into HTTP headers.
composer require perf/http-status
<?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"
<?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"