<?php

declare(strict_types=1);

namespace App\Framework\Discovery\Plugins;

use App\Framework\Discovery\DiscoveryDataCollector;
use App\Framework\Discovery\Results\DiscoveryRegistry;
use App\Framework\Discovery\ValueObjects\FileContext;
use App\Framework\Filesystem\ValueObjects\FilePath;

interface DiscoveryPlugin
{
    /**
     * Get the name of this plugin
     */
    public function getName(): string;

    /**
     * Check if this plugin can process the given file
     */
    public function canProcess(FilePath $file, FileContext $context): bool;

    /**
     * Process a file and collect discovery data
     */
    public function processFile(FilePath $file, FileContext $context, DiscoveryDataCollector $collector): void;

    /**
     * Post-process the discovery results (optional)
     * This is called after all files have been processed
     */
    public function postProcess(DiscoveryRegistry $registry): DiscoveryRegistry;
}
