<?php
/**
 * HappyFenceNG Total Enterprise Security Plugin
 * HAPPYWPRESS is a RazorVue Trademark.
 *
 * @package     HappyFenceNG
 * @developer   Simonluca Scillitani
 * @copyright   2025 RazorVue di Scillitani Simonluca
 * @link        https://razorvue.it
 * @author      RazorVue di Scillitani Simonluca
 * @brand       HappyWPress
 * @uri         https://happywpress.com
 * @set all
 */

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

/**PHPCS -> code compliance: we put useful comments where needed.. */
class HappyFenceNGCRcontrol extends HappyFenceNGRuntimeExceptions {
	/**PHPCS -> code compliance: we put useful comments where needed.. */
	public function __construct() {
		parent::__constructor( static::class );
	}

	/**PHPCS -> code compliance: we put useful comments where needed..
	 *
	 * @param string $who ... is the route name.
	 */
	public static function getRoute( $who ) {
		switch ( $who ) {
			case 'CFC':
				return new HappyFenceNGVRCF();
			case 'IPBL':
				return new HappyFenceNGVRIPBL();
			case 'AGG':
				return new HappyFenceNGVRAGG();
			case 'BUN':
				return new HappyFenceNGVRBUN();
			case 'DASH':
				return new HappyFenceNGVRDASH();
			case 'MCORE':
				return new HappyFenceNGVRMCORE();
			case 'DSEC':
				return new HappyFenceNGVRDSEC();
			case 'FUN':
				return new HappyFenceNGVRFUN();
			case 'GEO':
				return new HappyFenceNGVRGEO();
			case 'CLISEC':
				return new HappyFenceNGVRCLISEC();
			case 'LIC':
				return new HappyFenceNGVRLIC();
			case 'INTE':
				return new HappyFenceNGVRINTE();
			case 'MFA':
				return new HappyFenceNGVRMFA();
			case 'MLOG':
				return new HappyFenceNGVRMLOG();
			case 'PF':
				return new HappyFenceNGVRPF();
			case 'PRE':
				return new HappyFenceNGVRPRE();
			case 'PRI':
				return new HappyFenceNGVRPRI();
			case 'RESH':
				return new HappyFenceNGVRRESH();
			case 'SUSQ':
				return new HappyFenceNGVRSUSQ();
			case 'UPG':
				return new HappyFenceNGVRUPG();
			default:
				HappyFenceNGLOGCORE::logcore(
					'Routing error: ' . $who . ' is unknown.',
					HappyFenceNGSyslogFacility::CORE,
					HappyFenceNGSyslogSeverity::ERROR
				);
				HappyFenceNGCleaner::cleaner_oops( 'We cannot accept this request.' );
		}
	}
}
