<?php

namespace Soft_Tehnica\Freya_Sync_Service\STUtils;

class STView
{

    /**
     * @param array<string, mixed> $params
     */
    public static function render( string $view, array $params = [] ): string
    {
        $file = sprintf( '%s/templates/%s.php', fsRootPath, $view );

        // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
        extract( $params, EXTR_SKIP );
        ob_start();
        include $file;

        return ob_get_clean();
    }
}
