<?php

declare(strict_types=1);

namespace App\Framework\LiveComponents\ParameterBinding;

use App\Framework\DI\Attributes\Initializer;
use App\Framework\DI\Container;
use App\Framework\LiveComponents\ComponentEventDispatcher;

/**
 * ParameterBinder Initializer
 *
 * Registers ParameterBinder in DI container with ComponentEventDispatcher dependency.
 */
final readonly class ParameterBinderInitializer
{
    #[Initializer]
    public function __invoke(Container $container): ParameterBinder
    {
        $eventDispatcher = $container->get(ComponentEventDispatcher::class);

        return new ParameterBinder($eventDispatcher);
    }
}
