<?php

declare(strict_types=1);

namespace App\Framework\Mcp;

use App\Framework\Attributes\Initializer;
use App\Framework\Core\PathProvider;
use App\Framework\Discovery\Results\DiscoveryRegistry;
use App\Framework\Discovery\UnifiedDiscoveryService;
use App\Framework\Mcp\Tools\Categories\Codebase\CodebaseAnalyzer;
use App\Framework\Reflection\ReflectionProvider;

/**
 * Initializer for CodebaseAnalyzer MCP Tool
 */
final readonly class CodebaseAnalyzerInitializer
{
    public function __construct(
        private UnifiedDiscoveryService $discoveryService,
        private DiscoveryRegistry $discoveryRegistry,
        private ReflectionProvider $reflectionProvider,
        private PathProvider $pathProvider
    ) {
    }

    #[Initializer]
    public function __invoke(): CodebaseAnalyzer
    {
        return new CodebaseAnalyzer(
            $this->discoveryService,
            $this->discoveryRegistry,
            $this->reflectionProvider,
            $this->pathProvider
        );
    }
}
