<?php

declare(strict_types=1);

namespace App\Framework\LiveComponents\Security;

use App\Framework\DI\Initializer;
use App\Framework\Http\Session\SessionInterface;

/**
 * Initializer for ActionAuthorizationChecker
 *
 * Registers SessionBasedAuthorizationChecker as default implementation.
 * Can be overridden by binding custom implementation in container.
 */
final readonly class ActionAuthorizationCheckerInitializer
{
    public function __construct(
        private SessionInterface $session
    ) {
    }

    #[Initializer]
    public function __invoke(): ActionAuthorizationChecker
    {
        // Return SessionBasedAuthorizationChecker as default implementation
        return new SessionBasedAuthorizationChecker($this->session);
    }
}
