Download the PHP package sinemacula/http-primitives-php without Composer
On this page you can find all versions of the php package sinemacula/http-primitives-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sinemacula/http-primitives-php
More information about sinemacula/http-primitives-php
Files in sinemacula/http-primitives-php
Package http-primitives-php
Short Description Standalone, framework-agnostic PHP 8.3+ package providing typed backed enums for HTTP protocol primitives with zero runtime dependencies.
License Apache-2.0
Informations about the package http-primitives-php
HTTP Primitives
Standalone, framework-agnostic PHP 8.3+ package providing typed backed enums for HTTP protocol primitives. Zero runtime dependencies.
Enums
| Enum | Backing Type | Cases | Description |
|---|---|---|---|
HttpStatus |
int |
63 | All standard HTTP status codes (1xx-5xx) |
HttpMethod |
string |
9 | HTTP request methods per RFC 9110 |
MediaType |
string |
43 | Common MIME types across 7 categories |
HttpHeader |
string |
61 | Standard and non-standard HTTP headers |
CacheDirective |
string |
16 | Cache-Control directive values |
AuthScheme |
string |
3 | HTTP authentication schemes |
Charset |
string |
20 | Common character encodings |
All enums live under the SineMacula\Http\Enums namespace.
Helper Methods
Each enum includes contextual helper methods:
- HttpStatus --
getCode(),getStatusLine(),getReasonPhrase(),isInformational(),isSuccess(),isRedirection(),isClientError(),isServerError() - HttpMethod --
getVerb(),isSafe(),isIdempotent() - MediaType --
getMimeType(),withCharset(),getExtension(),isApplication(),isText(),isMultipart(),isImage(),isAudio(),isVideo(),isFont() - HttpHeader --
getName(),isStandard() - CacheDirective --
isRequestDirective(),isResponseDirective() - Charset --
getEncoding()
Installation
Usage
Requirements
- PHP 8.3+
Testing
Changelog
See CHANGELOG.md for a list of notable changes.
Contributing
Contributions are welcome. Please read CONTRIBUTING.md for guidelines on branching, commits, code quality, and pull requests.
Security
If you discover a security vulnerability, please report it responsibly. See SECURITY.md for the disclosure policy and contact details.
License
Licensed under the Apache License, Version 2.0.