Skip to content

tomrf/http-emitter

Repository files navigation

http-emitter - PSR-7 response emitter

PHP Version Require Latest Stable Version License

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::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