<?php
/**
 * File Path: includes/helpers/cover-strategies/class-mbs-cover-strategy-placeholder.php
 *
 * Cover Strategy — Plugin Placeholder (Level 4, FREE fallback)
 *
 * Lowest-priority strategy in the cover resolution chain. Always resolves —
 * this is the guaranteed terminal strategy that ensures MBS_Cover_Renderer::render()
 * never returns an empty string for a registered site. Renders the plugin's
 * built-in placeholder image via MBS_Cover_Image_Builder.
 *
 * @package    My_Book_Showroom
 * @subpackage Includes/Helpers/Cover_Strategies
 * @since      1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class MBS_Cover_Strategy_Placeholder implements MBS_Cover_Strategy { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- mbs_/MBS_ prefix is correct; scanner not configured with plugin prefix

	/**
	 * @inheritDoc
	 *
	 * Always returns non-empty HTML. The $format_row parameter is accepted
	 * to satisfy the interface contract but is not used by this strategy.
	 */
	public static function resolve( int $post_id, ?object $format_row ): string {
		$placeholder_url = MBS_ASSETS_URL . 'images/placeholder.svg';
		return MBS_Cover_Image_Builder::render( $placeholder_url, 'placeholder', $post_id );
	}
}
