<?php

declare(strict_types=1);

namespace App\Core;

/**
 * MiddlewareInterface
 *
 * $next is the rest of the pipeline (either the next middleware, or
 * finally the route handler). A middleware can:
 *   - inspect/reject the request before calling $next() (auth, CSRF, rate limiting)
 *   - call $next() and inspect/modify the Response it returns
 *   - short-circuit entirely by returning its own Response without calling $next()
 */
interface MiddlewareInterface
{
    public function handle(Request $request, callable $next): Response;
}
