<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase, WordPress.Files.FileName.InvalidClassFileName
/**
 * Template Renderer Interface.
 *
 * @package Autoship
 * @subpackage Templates
 * @since 2.13.0
 */

namespace Autoship\Services\Templates;

/**
 * Service contract for rendering plugin templates with theme override
 * support.
 *
 * Resolves a logical template name (relative to the `templates/`
 * directory, without the `.php` extension) by first looking in the
 * active theme's `autoship-cloud/templates/` directory and falling
 * back to the plugin's bundled template. Variables in `$vars` are
 * exposed to the template via PHP variable scoping.
 *
 * @package Autoship
 * @subpackage Templates
 * @since 2.13.0
 */
interface TemplateRendererInterface {

	/**
	 * Render a template, with theme override support.
	 *
	 * @param string               $template Logical template name (e.g.
	 *                                       `scheduled-orders/snooze-form-template`).
	 * @param array<string, mixed> $vars     Variables to expose to the template.
	 *
	 * @return void
	 */
	public function render( string $template, array $vars = array() ): void;
}
