<?php

namespace App\Framework\Http;

use WeakMap;

class MiddlewareStateManager
{
    private Weakmap $requestStates;

    public function __construct()
    {
        $this->requestStates = new WeakMap();
    }

    public function forRequest(Request $request): RequestStateManager
    {
        return new RequestStateManager($this->requestStates, $request);
    }
}
