sabroan / http-emitter
A PSR-7 HTTP response emitter
dev-main
2026-10-14 10:03 UTC
Requires
- php: >=8.5
- psr/http-message: ^2
- sabroan/http-emitter-interface: ^1
Requires (Dev)
- ergebnis/composer-normalize: ^2.54
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.3
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-strict-rules: ^2.1
- phpunit/phpunit: ^13
- roave/security-advisories: dev-latest
- vimeo/psalm: ^7@beta
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-14 10:07:09 UTC
README
A lightweight PHP HTTP response emitter.
Installation
composer require sabroan/http-emitter
Usage
Pass a PSR-7 ResponseInterface instance to SapiEmitter::emit():
<?php declare(strict_types=1); use Psr\Http\Message\ResponseInterface; use Sabroan\Http\Emitter\SapiEmitter; /** @var ResponseInterface $response */ $emitter = new SapiEmitter(); $emitter->emit($response);
The emitter sends the response status and headers using PHP's native SAPI functions, then writes the response body to the output. The emit() method returns true when emission completes successfully.
License
This package is released under the MIT License. See the LICENSE file for details.