<?php

declare(strict_types=1);

namespace SecurWP\Modules\Tools;

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use SecurWP\Includes\Interfaces\Module;
use SecurWP\Includes\Module_Loader;

/**
 * Register the Security Tools module.
 */
class Tools implements Module {

	/**
	 * The plugin identifier.
	 *
	 * @var string
	 */
	private string $plugin_name;

	/**
	 * The plugin version.
	 *
	 * @var string
	 */
	private string $version;

	/**
	 * Constructor.
	 *
	 * @param string $plugin_name The name of the plugin.
	 * @param string $version     The version of this plugin.
	 */
	public function __construct( string $plugin_name, string $version ) {
		$this->plugin_name = $plugin_name;
		$this->version     = $version;
	}

	/**
	 * Register module hooks.
	 *
	 * @param Module_Loader $loader The module loader instance.
	 * @return void
	 */
	public function initialize( Module_Loader $loader ): void {
		$api = new ToolsApi();
		$loader->add_action( 'rest_api_init', $api, 'register_routes' );
	}
}
