tomrf / http-emitter
PSR-7 response emitter
0.0.2
2022-06-15 21:04 UTC
Requires
- php: >=8.0
- psr/http-message: ^1.0
Requires (Dev)
- fakerphp/faker: ^1.19
- friendsofphp/php-cs-fixer: ^3.8
- nyholm/psr7: ^1.5
- nyholm/psr7-server: ^1.0
- phpmd/phpmd: ^2.12
- phpstan/phpstan: ^1.6
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- tomrf/readme-gen: ^0.0.5
This package is auto-updated.
Last update: 2024-10-20 04:01:56 UTC
README
Simple PSR-7 response emitter with sensible CLI SAPI output
📔 Go to documentation
Installation
Installation via composer:
composer require tomrf/http-emitter
Usage
$httpEmitter = new HttpEmitter(); $httpEmitter->emit($response); // PSR-7 response object
Testing
composer test
License
This project is released under the MIT License (MIT). See LICENSE for more information.
Documentation
- Tomrf\HttpEmitter\HttpEmitter
- Tomrf\HttpEmitter\Sapi\SapiCliEmitter
- Tomrf\HttpEmitter\Sapi\SapiEmitter
📂 Tomrf\HttpEmitter\HttpEmitter::class
PSR-7 message response emitter.
emit()
Emits the response using SapiEmitter or SapiCliEmitter based on current PHP SAPI.
public function emit( Psr\Http\Message\ResponseInterface $response ): void
📂 Tomrf\HttpEmitter\Sapi\SapiCliEmitter::class
PSR-7 message response emitter for SAPI cli.
emit()
Emits the response to terminal.
public function emit( Psr\Http\Message\ResponseInterface $response ): void
📂 Tomrf\HttpEmitter\Sapi\SapiEmitter::class
Generic PSR-7 message response emitter for SAPI.
emit()
Emits the response to standard output.
public function emit( Psr\Http\Message\ResponseInterface $response ): void
Generated 2022-06-15T23:05:29+02:00 using 📚tomrf/readme-gen