<?php
/**
 * Provider requirement compatibility report.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Provider;

/**
 * Reports missing and version-changed providers for an immutable plan.
 */
final class ProviderRequirementReport {
	/**
	 * @var string[]
	 */
	private array $missing;
	/**
	 * @var array<string, array{required: string, installed: string}>
	 */
	private array $changed;
	/**
	 * @param string[]                                              $missing Missing provider IDs.
	 * @param array<string,array{required:string,installed:string}> $changed Version mismatches.
	 */
	public function __construct( array $missing, array $changed ) {
		$this->missing = $missing;
		$this->changed = $changed;
	}

	public function compatible(): bool {
		return array() === $this->missing && array() === $this->changed;
	}

	/**
	 * @return string[]
	 */
	public function missing(): array {
		return $this->missing;
	}

	/**
	 * @return array<string,array{required:string,installed:string}>
	 */
	public function changed(): array {
		return $this->changed;
	}
}
