perf / http-status
Allows to interact with HTTP status strings to be injected into HTTP headers.
Installs: 4 246
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.4
Requires (Dev)
- ext-xdebug: *
- phing/phing: ^2.16
- phpmd/phpmd: ^2.8
- phpunit/phpunit: ^9.2
- squizlabs/php_codesniffer: ^3.5
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"