rayanlevert / http
PHP enumerations for HTTP codes and methods
v1.0.0
2024-05-01 18:24 UTC
Requires
- php: >=8.1
Requires (Dev)
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.7
README
Refer to php-fig https://github.com/php-fig/http-message-util
RayanLevert\Http\Codes
PHP enumeration with HTTP codes RayanLevert\Http\Codes
DisDev\Http\Methods
PHP enumeration with HTTP methods
enum Methods: string { case HEAD = 'HEAD'; case GET = 'GET'; case POST = 'POST'; case PUT = 'PUT'; case PATCH = 'PATCH'; case DELETE = 'DELETE'; case PURGE = 'PURGE'; case OPTIONS = 'OPTIONS'; case TRACE = 'TRACE'; case CONNECT = 'CONNECT'; } \RayanLevert\Http\Methods::HEAD // 'HEAD'
RayanLevert\Http\Exception
PHP exception initialized with an HTTP code with RayanLevert\Http\Codes
// HTTP 401 error $oException = new \RayanLevert\Http\Exception('Unauthorized', \RayanLevert\Http\Codes::CLIENT_UNAUTHORIZED)