Download the PHP package liquidrazor/http-contracts without Composer
On this page you can find all versions of the php package liquidrazor/http-contracts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download liquidrazor/http-contracts
More information about liquidrazor/http-contracts
Files in liquidrazor/http-contracts
Package http-contracts
Short Description HTTP transport contracts and immutable scaffold implementations for LiquidRazor Framework.
License MIT
Informations about the package http-contracts
LiquidRazor HTTP Contracts
liquidrazor/http-contracts defines the HTTP transport vocabulary for the LiquidRazor Framework.
It provides HTTP request and response contracts, immutable scaffold implementations, concrete HTTP implementations of liquidrazor/transport-contracts, request-body parameter bag scaffolding, optional DTO gateway contracts/defaults, immutable HTTP exchange state, and HTTP lifecycle event contracts/value objects.
It does not implement an HTTP kernel or runtime.
Table of Contents
- Purpose
- Architectural Position
- Implemented Surface
- Not Implemented
- Request and Response
- Request Body
- Transport Integration
- DTO Gateway
- HTTP Exchange
- Lifecycle Events
- Directory Layout
- Focused Docs
- License
Purpose
This package describes HTTP-shaped input and output for LiquidRazor. It provides stable HTTP contracts and small immutable defaults without taking ownership of request execution.
Architectural Position
This package sits on top of liquidrazor/transport-contracts and supplies the HTTP-specific payload model used by future HTTP runtime layers.
Current mapping:
Implemented Surface
Implemented here:
HttpRequestInterfaceand immutableHttpRequestHttpResponseInterfaceand immutableHttpResponseRequestBodyInterface,RequestBodyType, and immutableRequestBody- request-side URI, header, and uploaded-file scaffolds
- response-side header and cookie scaffolds
HttpTransportInput,HttpTransportOutput, andHttpTransportContextHttpExchangeInterfaceand immutableHttpExchangeHttpRequestDtoResolverInterfaceandHttpResponseDtoResolverInterfaceNullHttpRequestDtoResolverandNullHttpResponseDtoResolver- HTTP lifecycle event interfaces and immutable lifecycle event classes
Not Implemented
This package intentionally does not provide:
- an HTTP kernel
- routing
- controller resolution or invocation
- middleware runtime
- request capture from globals
- response emission
- SAPI adapters
- PSR bridges
- Symfony bridges
- RoadRunner bridges
- FrankenPHP bridges
- dependency injection wiring
- MicroKernel execution integration
Request and Response
The request contract models an already-normalized HTTP request. The response contract models a response description ready for a later runtime or emitter layer.
Minimal example:
Request Body
Structured request body access is explicit:
This package does not expose parsed body as mixed, and it does not put an anonymous parsed-body array directly on the request contract.
RequestBodyInterface separates raw body from structured body:
body()onHttpRequestInterfaceexposes the raw string body ornullrequestBody()exposes structured request-body state
Implemented body types:
Minimal example:
Transport Integration
HttpTransportInput, HttpTransportOutput, and HttpTransportContext implement the upstream contracts from liquidrazor/transport-contracts.
Transport name:
HttpTransportInput always carries an HttpRequestInterface payload.
HttpTransportOutput always carries an HttpResponseInterface payload.
Generic TransportStatus belongs to the transport output wrapper. HTTP response status code belongs to the HTTP response object itself.
Minimal example:
DTO Gateway
DTO support is optional.
This package provides:
HttpRequestDtoResolverInterfaceHttpResponseDtoResolverInterfaceNullHttpRequestDtoResolverNullHttpResponseDtoResolver
DTOs are not mandatory, and this package does not require DTO marker interfaces.
Default behavior:
NullHttpRequestDtoResolverreturns the originalHttpRequestInterfaceNullHttpResponseDtoResolverreturns an existingHttpResponseInterfaceunchangedNullHttpResponseDtoResolverreturnsnullfor non-response input
This package does not perform:
- serialization
- validation
- route-aware DTO mapping
- controller dispatch
HTTP Exchange
HttpExchange is an immutable lifecycle carrier for:
- request
- optional response
- transport context
- optional request DTO
- optional response DTO
Progression is represented through immutable with*() methods.
Minimal example:
Lifecycle Events
This package provides lifecycle event value objects only.
Implemented event catalog:
Each event carries HttpExchangeInterface.
This package does not provide:
- an event dispatcher
- a listener registry
- event discovery
- event priority rules
Directory Layout
Production code exists only in:
There is no src/ directory by design.
Focused Docs
- Request and Response
- Request Body
- Transport Integration
- DTO Gateway
- HTTP Exchange
- Lifecycle Events
License
MIT License.
All versions of http-contracts with dependencies
liquidrazor/transport-contracts Version ^0.1
liquidrazor/event-manager Version ^0.1