Fr3nch13/CakePHP Utilities

RequestHandlerRunner
in package
implements RequestHandlerRunnerInterface

FinalYes

"Run" a request handler.

The RequestHandlerRunner will marshal a request using the composed factory, and then pass the request to the composed handler. Finally, it emits the response returned by the handler using the composed emitter.

If the factory for generating the request raises an exception or throwable, then the runner will use the composed error response generator to generate a response, based on the exception or throwable raised.

Table of Contents

Interfaces

RequestHandlerRunnerInterface
"Run" a request handler.

Properties

$emitter  : EmitterInterface
$handler  : RequestHandlerInterface
A request handler to run as the application.
$serverRequestErrorResponseGenerator  : callable(Throwable): ResponseInterface
A factory capable of generating an error response in the scenario that the $serverRequestFactory raises an exception during generation of the request instance.
$serverRequestFactory  : callable(): ServerRequestInterface
A factory capable of generating a Psr\Http\Message\ServerRequestInterface instance.

Methods

__construct()  : mixed
run()  : void
Run the application
emitMarshalServerRequestException()  : void

Properties

$serverRequestErrorResponseGenerator

A factory capable of generating an error response in the scenario that the $serverRequestFactory raises an exception during generation of the request instance.

private callable(Throwable): ResponseInterface $serverRequestErrorResponseGenerator

The factory will receive the Throwable or Exception that caused the error, and must return a Psr\Http\Message\ResponseInterface instance.

$serverRequestFactory

A factory capable of generating a Psr\Http\Message\ServerRequestInterface instance.

private callable(): ServerRequestInterface $serverRequestFactory

The factory will not receive any arguments.

Methods

emitMarshalServerRequestException()

private emitMarshalServerRequestException(Throwable $exception) : void
Parameters
$exception : Throwable

        
On this page

Search results