nyholm/psr7
Nyholm PSR-7 is a super lightweight, strict, and fast implementation of PSR-7 with full PSR-17 factories and HTTPlug/PSR-18 compatibility. Create requests, streams, URIs, and server requests with minimal overhead.
Architecture fit: This package is ideal as a foundational PSR-7 implementation for middleware-based systems (e.g., Symfony, custom HTTP stacks) due to its strict adherence to specifications and minimal codebase (1k LOC). It excels in performance-critical scenarios where lightweight, high-throughput HTTP message handling is required, but lacks abstraction for framework-specific features.
Integration feasibility: High. Composer-based installation with clear PSR-17/PSR-18 compatibility (e.g., works seamlessly with HTTPlug clients, Laminas emitter). Integration requires minimal code changes—primarily replacing existing factories with Nyholm\Psr7\Factory\Psr17Factory and ensuring all HTTP interactions use PSR interfaces.
Technical risk: Moderate. Recent security fixes (CVE-2023-29197) and active maintenance (2024-09-09 release) reduce risk, but the removal of final keywords in 1.4.0 may encourage unsafe class extensions despite documentation warnings. Dependents count (0) is misleading—while direct dependents are low, it's a foundational PSR implementation used indirectly in many ecosystems.
Key questions:
nyholm/psr7-server or a custom solution?Stack fit: Best suited for PHP 7.2+ applications using PSR standards. Works natively with Symfony (via Flex service registration), Laminas, and custom middleware stacks. Less optimal for Laravel out-of-the-box (which defaults to Guzzle's PSR-7 implementation) but feasible with adapter layers.
Migration path:
nyholm/psr7 via Composer.Psr17Factory (e.g., `createRequestHow can I help you explore Laravel packages today?