<?php

declare(strict_types=1);

namespace App\Framework\Discovery\Contracts;

use App\Framework\Discovery\Results\DiscoveryRegistry;
use App\Framework\Discovery\ValueObjects\DiscoveryContext;

/**
 * Contract for discovery plugins that extend the discovery process
 */
interface DiscoveryPlugin
{
    /**
     * Get the plugin name
     */
    public function getName(): string;

    /**
     * Initialize the plugin before discovery starts
     */
    public function initialize(DiscoveryContext $context): void;

    /**
     * Finalize the plugin after discovery completes
     */
    public function finalize(DiscoveryContext $context, DiscoveryRegistry $registry): void;

    /**
     * Get the visitors this plugin provides
     *
     * @return array<DiscoveryVisitor>
     */
    public function getVisitors(): array;

    /**
     * Check if the plugin is enabled for the given context
     */
    public function isEnabled(DiscoveryContext $context): bool;
}
