<?php

declare(strict_types=1);

namespace App\Framework\Discovery\Interfaces;

/**
 * Interface for visitors that need lifecycle management
 *
 * Provides hooks for different phases of the discovery process,
 * allowing visitors to optimize their behavior for full vs incremental scans.
 */
interface LifecycleAwareVisitor
{
    /**
     * Called when a full discovery scan starts
     *
     * Use this to initialize data structures and reset state
     */
    public function onScanStart(): void;

    /**
     * Called when a full discovery scan completes
     *
     * Use this for post-processing, optimization, or cleanup
     */
    public function onScanComplete(): void;

    /**
     * Called when an incremental scan starts
     *
     * Use this to prepare for partial updates while preserving existing data
     */
    public function onIncrementalScanStart(): void;

    /**
     * Called when an incremental scan completes
     *
     * Use this for incremental post-processing or index updates
     */
    public function onIncrementalScanComplete(): void;
}
