<?php

declare(strict_types=1);

namespace App\Framework\FormGenerator;

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

final readonly class FormGeneratorInitializer
{
    #[Initializer]
    public function __invoke(Container $container): RequestFormGenerator
    {
        $typeResolver = new FieldTypeResolver();
        $attributeMapper = new ValidationAttributeMapper();
        $analyzer = new RequestPropertyAnalyzer($typeResolver, $attributeMapper);

        return new RequestFormGenerator($analyzer);
    }
}
