PHP Class Phly\Conduit\FinalHandler

Afficher le fichier Open project: phly/conduit

Méthodes publiques

Méthode Description
__construct ( array $options = [] )
__invoke ( Request $request, Response $response, mixed $err = null ) : Response Handle incomplete requests

Private Methods

Méthode Description
create404 ( Request $request, Response $response ) : Response Create a 404 status in the response
createDevelopmentErrorMessage ( $error )
getStatusCode ( mixed $error, Response $response ) : integer Determine status code
handleError ( mixed $error, Request $request, Response $response ) : Response Handle an error condition
triggerError ( mixed $error, Request $request, Response $response ) Trigger the error listener, if present

Method Details

__construct() public méthode

public __construct ( array $options = [] )
$options array Options that change default override behavior.

__invoke() public méthode

This handler should only ever be invoked if Next exhausts its stack. When that happens, we determine if an $err is present, and, if so, create a 500 status with error details. Otherwise, a 404 status is created.
public __invoke ( Request $request, Response $response, mixed $err = null ) : Response
$request Phly\Conduit\Http\Request Request instance.
$response Phly\Conduit\Http\Response Response instance.
$err mixed
Résultat Phly\Conduit\Http\Response