PSR-15 Queue

QueueRequestHandler
in package
implements RequestHandlerInterface uses Getter

A queue-based PSR-15 HTTP Server Request Handler.

Tags
author

Sebastian Meyer sebastian.meyer@opencultureconsulting.com

Table of Contents

Interfaces

RequestHandlerInterface

Properties

$queue  : MiddlewareQueue
$request  : ServerRequestInterface
$response  : ResponseInterface

Methods

__construct()  : void
Create a queue-based PSR-15 HTTP Server Request Handler.
__invoke()  : ResponseInterface
Allow the request handler to be invoked directly.
handle()  : ResponseInterface
Handles a request by invoking a queue of middlewares.
respond()  : void
Return the current response to the client.

Properties

Methods

__construct()

Create a queue-based PSR-15 HTTP Server Request Handler.

public __construct([iterable<string|int, MiddlewareInterface$middlewares = [] ]) : void
Parameters
$middlewares : iterable<string|int, MiddlewareInterface> = []

Initial set of middlewares

__invoke()

Allow the request handler to be invoked directly.

public __invoke([ServerRequestInterface|null $request = null ]) : ResponseInterface
Parameters
$request : ServerRequestInterface|null = null

The PSR-7 server request to handle

Return values
ResponseInterface

A PSR-7 compatible HTTP response

handle()

Handles a request by invoking a queue of middlewares.

public handle([ServerRequestInterface|null $request = null ]) : ResponseInterface
APIYes
Parameters
$request : ServerRequestInterface|null = null

The PSR-7 server request to handle

Return values
ResponseInterface

A PSR-7 compatible HTTP response

respond()

Return the current response to the client.

public respond() : void
APIYes
Tags
throws
RuntimeException

if headers were already sent


        
On this page

Search results