<?php

declare(strict_types=1);

namespace BotGuard\Middleware;

use BotGuard\Core\Request;
use BotGuard\Core\Response;
use Closure;

/**
 * Contract for middleware in the request pipeline.
 *
 * A middleware either returns a Response early (short-circuiting the pipeline)
 * or calls $next($request) to hand control to the next layer / the controller.
 */
interface MiddlewareInterface
{
    public function handle(Request $request, Closure $next): Response;
}
