tomrf / http-emitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

License:MIT License


Languages

Language:PHP 100.0%