<?php
/**
 * Contract for read-only Speed collectors.
 *
 * @package MarketingConsole
 */

namespace MarketingConsole\Modules\Speed\Collectors;

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

/**
 * A collector returns one or more schema field records.
 */
interface CollectorInterface {

	/**
	 * Stable, non-sensitive collector identifier.
	 *
	 * @return string
	 */
	public function key(): string;

	/**
	 * Collect schema fields without changing WordPress or the host.
	 *
	 * Each returned field is a per-field array containing at least value and
	 * status. Optional source, observed_at and error_code keys follow the same rule.
	 *
	 * @return array<string,array<string,mixed>>
	 */
	public function collect(): array;
}
