<?php
/**
 * Core repository instances shared by module builders.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Bootstrap;

use ScheduledChanges\Repository\WpdbLaunchRepository;
use ScheduledChanges\Repository\WpdbLaunchVersionRepository;
use ScheduledChanges\Repository\WpdbRecordingSessionRepository;

/**
 * Groups durable storage dependencies assembled at bootstrap.
 */
final class CoreModuleRepositories {
	private WpdbRecordingSessionRepository $recordings;
	private WpdbLaunchRepository $launches;
	private WpdbLaunchVersionRepository $versions;

	/**
	 * Creates the shared core repository set.
	 */
	public function __construct(
		WpdbRecordingSessionRepository $recordings,
		WpdbLaunchRepository $launches,
		WpdbLaunchVersionRepository $versions
	) {
		$this->recordings = $recordings;
		$this->launches   = $launches;
		$this->versions   = $versions;
	}

	/**
	 * Returns recording session storage.
	 */
	public function recordings(): WpdbRecordingSessionRepository {
		return $this->recordings;
	}

	/**
	 * Returns launch storage.
	 */
	public function launches(): WpdbLaunchRepository {
		return $this->launches;
	}

	/**
	 * Returns launch version storage.
	 */
	public function versions(): WpdbLaunchVersionRepository {
		return $this->versions;
	}
}
