<?php

declare(strict_types=1);

/**
 * PhaseServiceInterface - Contract for scan phase services.
 *
 * Each phase service owns one logical phase of the scan pipeline.
 * ScanOrchestrator::run_v2() iterates over registered phase services
 * in round-robin order, calling tick() until the scan is complete.
 *
 */

namespace SecurWP\Modules\Scanner\Queue\Phase;

if ( ! defined( 'ABSPATH' ) ) { exit; }

interface PhaseServiceInterface {

    /**
     * Execute one round-robin tick of this phase.
     *
     * @param array $stats Reference to the orchestrator stats array.
     * @return bool True if meaningful work was performed.
     */
    public function tick( array &$stats ): bool;

    /**
     * Returns true when this phase has no more work for this scan.
     * Used by the orchestrator to skip phases during the RR loop.
     *
     * @return bool
     */
    public function is_complete(): bool;

    /**
     * Phase identifier string used as the RR state key.
     *
     * @return string
     */
    public function get_phase_name(): string;
}
