ValidationMiddleware
in package
implements
MiddlewareInterface
Interfaces, Classes and Traits
- MiddlewareInterface
Table of Contents
- $container : Container
- The middleware needs access to the container, so that we can interact with other components of the system appropriately.
- $response : RequestHandlerInterface|null
- $rules : Collection<string|int, ValidationRule>
- __construct() : mixed
- after() : mixed
- before() : mixed
- process() : ResponseInterface
- Handle the request, performing validation.
Properties
$container
The middleware needs access to the container, so that we can interact with other components of the system appropriately.
private
Container
$container
$response
private
RequestHandlerInterface|null
$response
$rules
private
Collection<string|int, ValidationRule>
$rules
Methods
__construct()
public
__construct(Container $container, Collection $rules, RequestHandlerInterface|null $errorpage) : mixed
Parameters
- $container : Container
- $rules : Collection
- $errorpage : RequestHandlerInterface|null
Return values
mixed —after()
public
after(ContextInterface $context[, Response $response = null ]) : mixed
Parameters
- $context : ContextInterface
- $response : Response = null
Tags
Return values
mixed —before()
public
before(ContextInterface $context) : mixed
Parameters
- $context : ContextInterface
Tags
Return values
mixed —process()
Handle the request, performing validation.
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface