<?php
/**
 * Validator Interface
 *
 * Defines the contract for workflow validators.
 *
 * @package Sequensy\Validation\Contracts
 * @since 2.0.0
 */

declare(strict_types=1);

namespace Sequensy\Validation\Contracts;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

/**
 * Interface ValidatorInterface
 *
 * All workflow validators must implement this interface.
 */
interface ValidatorInterface {

	/**
	 * Validate configuration.
	 *
	 * @param array $config  Configuration to validate.
	 * @param array $context Additional context for validation.
	 * @return array Validation result with 'valid' boolean and 'errors' array.
	 */
	public function validate( array $config, array $context = array() ): array;

	/**
	 * Get collected errors.
	 *
	 * @return array Array of error objects.
	 */
	public function get_errors(): array;

	/**
	 * Clear collected errors.
	 *
	 * @return void
	 */
	public function clear_errors(): void;
}
