<?php
/**
 * Shared hydrate pipeline.
 *
 * @package EntryFoundry
 */

namespace EntryFoundry\Core\Services\Hydrate;

use EntryFoundry\Core\Services\Extension\HydrateStepRegistry;
// phpcs:disable Squiz.Commenting, Generic.Commenting.DocComment

final class HydratePipeline {
	/** @var HydrateStepRegistry */ private $steps;
	public function __construct( HydrateStepRegistry $steps ) {
		$this->steps = $steps; }
	/** @param array<string,mixed> $template @param array<string,mixed> $context @return array<string,mixed> */
	public function hydrate( array $template, array $context ): array {
		return $this->steps->apply( $template, $context ); }
}
