PHP Class Psr7Middlewares\Middleware\Delay

Show file Open project: oscarotero/psr7-middlewares

Protected Properties

Property Type Description
$seconds

Public Methods

Method Description
__construct ( integer | array $seconds = [1, 2] ) Set the seconds to delay.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.

Method Details

__construct() public method

Set the seconds to delay.
public __construct ( integer | array $seconds = [1, 2] )
$seconds integer | array Use an array to random values [min, max]

__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

Property Details

$seconds protected property

protected $seconds