<?php
/**
 * AdminMenuHook class.
 *
 * Registers the admin menu entry using SettingsPageRenderer.
 *
 * @package Ilabs\Firevert\Core\Hooks\Admin
 */

declare( strict_types=1 );

namespace Ilabs\Firevert\Core\Hooks\Admin;

use Ilabs\Firevert\Core\Settings\UI\SettingsPageRenderer;

/**
 * Class AdminMenuHook
 *
 * Hooks SettingsPageRenderer into the WordPress admin menu.
 */
class AdminMenuHook {

	/**
	 * Renderer responsible for outputting the settings page.
	 *
	 * @var SettingsPageRenderer
	 */
	private SettingsPageRenderer $renderer;

	/**
	 * Constructor.
	 *
	 * @param SettingsPageRenderer $renderer Get from DI container.
	 */
	public function __construct( SettingsPageRenderer $renderer ) {
		$this->renderer = $renderer;
	}

	/**
	 * Registers the admin_menu action.
	 */
	public function register(): void {
		add_action( 'admin_menu', array( $this->renderer, 'register_menu' ) );
	}
}
