phrity/http
Phrity Http provides small PSR-friendly utilities for HTTP in PHP. Includes an HttpFactory wrapper that combines PSR-17 factories (or auto-configures from a single implementation) and a Serializer that converts PSR-7 requests/responses/messages to raw HTTP strings.
| Component | Failure Scenario | Impact | Mitigation |
|---|---|---|---|
| HttpFactory | Missing factory (e.g., uploadedFileFactory) |
BadMethodCallException thrown. |
Provide default factories or validate inputs before instantiation. |
| Serializer | Malformed PSR-7 message | Invalid string output or crashes. | Add validation (e.g., instanceof Psr\Http\Message\RequestInterface). |
| Dependency | Package abandoned or incompatible updates | Breaking changes in future versions. | Fork the repo or pin versions in composer.json. |
| Laravel Integration | Conflicts with core HTTP stack | Unexpected behavior in request/response handling. | Test in isolation; use dependency injection to swap factories. |
| Performance | Serializer bottleneck in high traffic | Increased latency or memory usage. | Cache serialized outputs or stream responses for large payloads. |
HttpFactory to Laravel’s native factories.HttpFactory and integrate the serializer into logging.HttpFactory and serializer outputs in the pipeline.Phrity\Http classes for autocompletion.new GuzzleHttp\Psr7\Request()).Illuminate\Http\Factory if HttpFactory causes issues.dd()/toArray() methods.How can I help you explore Laravel packages today?