PHP Class Psr7Middlewares\Middleware\Honeypot

Inheritance: use trait Psr7Middlewares\Utils\FormTrait, use trait Psr7Middlewares\Utils\AttributeTrait
Show file Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null Returns a callable to generate the inputs.
inputClass ( string $inputClass ) : self Set the field class.
inputName ( string $inputName ) : self Set the field name.

Private Methods

Method Description
isValid ( Psr\Http\Message\ServerRequestInterface $request ) : boolean Check whether the request is valid.

Method Details

__invoke() public method

Execute the middleware.
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$next callable
return Psr\Http\Message\ResponseInterface

getGenerator() public static method

Returns a callable to generate the inputs.
public static getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null
$request Psr\Http\Message\ServerRequestInterface
return callable | null

inputClass() public method

Set the field class.
public inputClass ( string $inputClass ) : self
$inputClass string
return self

inputName() public method

Set the field name.
public inputName ( string $inputName ) : self
$inputName string
return self