1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Curler;
4:
5: use Psr\Http\Message\RequestInterface;
6: use Salient\Contract\Http\HttpResponseInterface;
7: use Closure;
8:
9: /**
10: * @api
11: */
12: interface CurlerMiddlewareInterface
13: {
14: /**
15: * Act on a request and generate a response, optionally forwarding the
16: * request to the next handler and acting on its response
17: *
18: * @param Closure(RequestInterface): HttpResponseInterface $next
19: */
20: public function __invoke(RequestInterface $request, Closure $next, CurlerInterface $curler): HttpResponseInterface;
21: }
22: