<?php
/**
 * @author     FutrX
 * @year       2023
 * @package    futrx.com
 * @subpackage NoMoreBots
 */

namespace NoMoreBots;

use NoMoreBots\Admin;
use NoMoreBots\Hooks;
use NoMoreBots\Rest;


class Init {
	public function __construct() {
		$this->register_modules();
		$this->register_admin();
		$this->register_enqueue();
		$this->register_hooks();
		$this->register_rest();
	}
	/**
	 * This registers all modules, required for the plugin.
	 */
	public function register_modules(): void {
		foreach ( NOMOREBOTS_ACTIVE_MODULES as $module ) {
			new $module();
		}
	}

	/**
	 * This registers all Admin related functionality.
	 * An "admin-related functionality" is a functionality that exists in the Admin Dashboard.
	 *
	 * @since 1.0.0
	 * @return void
	 */
	public function register_admin(): void {
		new Admin\Pages();
	}

	/**
	 * This registers the Enqueue class.
	 */
	public function register_enqueue(): void {
		new Enqueue();
	}

	/**
	 * This should register all hooks, required for the plugin.
	 *
	 * @since 1.0.0
	 * @return void
	 */
	public function register_hooks(): void {
		new Hooks\Access();
		new Hooks\Forms();
	}

	/**
	 * This should register all REST endpoints, required for the plugin.
	 *
	 * @since 1.0.0
	 * @return void
	 */
	public function register_rest(): void {
		new Rest\OTP();
	}
}
