RequestHandler
in package
implements
RequestHandlerInterface
uses
RequestHandlerTrait
Class RequestHandler
Table of Contents
Interfaces
- RequestHandlerInterface
Properties
- $container : ContainerInterface|null
- $handler : callable
- $middleware : array<int, string|MiddlewareInterface>
Methods
- __construct() : mixed
- Delegate constructor.
- addCallable() : $this
- Add callable initializing Middleware that will be executed as soon as possible.
- addMiddleware() : $this
- Add Middleware that will be executed as soon as possible.
- handle() : ResponseInterface
- {@inheritdoc}
Properties
$container
protected
ContainerInterface|null
$container
$handler
protected
callable
$handler
$middleware
protected
array<int, string|MiddlewareInterface>
$middleware
Methods
__construct()
Delegate constructor.
public
__construct(array<string|int, mixed> $middleware, callable $default[, ContainerInterface|null $container = null ]) : mixed
Parameters
- $middleware : array<string|int, mixed>
- $default : callable
- $container : ContainerInterface|null = null
addCallable()
Add callable initializing Middleware that will be executed as soon as possible.
public
addCallable(string $name, callable $callable) : $this
Parameters
- $name : string
- $callable : callable
Return values
$thisaddMiddleware()
Add Middleware that will be executed as soon as possible.
public
addMiddleware(string $name, MiddlewareInterface $middleware) : $this
Parameters
- $name : string
- $middleware : MiddlewareInterface
Return values
$thishandle()
{@inheritdoc}
public
handle(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface