<?php
/**
 * Launch-focused admin formatting.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Repository;

// phpcs:disable Squiz.Commenting.FunctionComment.ParamCommentFullStop -- Compact forwarding annotations document the facade surface inline.

/** Formats launch, target, operation, and schedule rows. */
final class AdminLaunchDisplayFormatter {
	private AdminDashboardValueFormatter $values;

	/** @param AdminDashboardValueFormatter $values Shared value formatter. */
	public function __construct( AdminDashboardValueFormatter $values ) {
		$this->values = $values;
	}

	/**
	 * @param array<string,mixed> $row Row.
	 * @return array<string,mixed>
	 */
	public function launchRow( array $row ): array {
		return $this->values->launchRow( $row );
	}

	/**
	 * @param array<string,mixed> $row Row.
	 * @return array<string,mixed>
	 */
	public function targetRow( array $row, string $context, bool $hooks = true ): array {
		return $this->values->targetRow( $row, $context, $hooks );
	}

	/** @param mixed $value Date value. */
	public function datePart( $value, string $timezone ): string {
		return $this->values->datePart( $value, $timezone );
	}

	/** @param mixed $value Time value. */
	public function timePart( $value, string $timezone ): string {
		return $this->values->timePart( $value, $timezone );
	}

	/**
	 * @param array<int,array<string,mixed>> $rows Rows.
	 * @return array<int,array<string,mixed>>
	 */
	public function operationRows( array $rows ): array {
		return $this->values->operationRows( $rows );
	}

	/** @param mixed $value Saved restore-point value. */
	public function restorePreviewValue( $value, string $field, string $type, bool $sensitive ): string {
		return $this->values->restorePreviewValue( $value, $field, $type, $sensitive );
	}
}
