<?php

declare(strict_types=1);

namespace App\Framework\Database;

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

final readonly class HydratorInitializer
{
    #[Initializer]
    public function __invoke(Container $container): HydratorInterface
    {
        $typeConverter = $container->get(TypeConverter::class);

        // Create Hydrator without EntityLoader to break circular dependency
        return new Hydrator($typeConverter);
    }
}
