psr/http-server-handler
PSR-15 HTTP Server RequestHandlerInterface package. Defines the standard request handler contract used with PSR-15 middleware and PSR-7 requests/responses. Provides interfaces only, not an implementation; implementations are available separately.
This PSR-15 interface package provides a standardized contract for HTTP request handlers with near-zero technical risk. Its architecture fit is exceptional for middleware-driven systems as it defines the precise contract for handler delegation without imposing implementation details. Integration feasibility is high since it's purely an interface – no runtime code to integrate, only dependency declarations. The package requires no direct usage; it's consumed by frameworks and middleware runners. Key risks are minimal but include: potential PSR-7 version conflicts if multiple HTTP message implementations exist in the stack (though PSR-7 1.x/2.x compatibility is maintained), and the common pitfall of attempting to install this package directly rather than relying on framework-provided implementations. Critical questions: Does our current framework (e.g., Laravel) already implement this interface internally? What PSR-7/PSR-17 implementations are we using? Are we building middleware components or framework-agnostic libraries that require this contract?
Stack fit is optimal for any PHP application using middleware patterns. In Laravel/Symfony, this interface is already implemented internally – no action needed. For custom middleware libraries, require this package as a dependency and implement RequestHandlerInterface in handler classes. Migration path is trivial: existing Laravel middleware (e.g., HandleRequests class) already conforms to this standard. Compatibility is guaranteed with any PSR-7 implementation (e.g., nyholm/psr7 or `
How can I help you explore Laravel packages today?