<?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 HappyFenceNGWhoAmI extends HappyFenceNGSystem {
    /**PHPCS -> code compliance: we put useful comments where needed..
     *
     * @var $c_a_n_o_n_i_c_a_l .
     */
    private static $c_a_n_o_n_i_c_a_l = HappyFenceNGPlaceholder::EMPTY_STRING;

    /**PHPCS -> code compliance: we put useful comments where needed.. */
    protected function __construct() {
        self::$c_a_n_o_n_i_c_a_l = HappyFenceNGTR::match();
    }

    /**PHPCS -> code compliance: we put useful comments where needed..
     *
     * @param string $property .. the property name.
     */
    public function __get( $property ) {
        try {
            $result = HappyFenceNGMulti::get_instance();
            switch ( $property ) {
                case 'TRAP404':
                    break;
                case 'CF':
                    $result = HappyFenceNGCFProps::get_instance();
                    break;
                case 'IPBL':
                    break;
                case 'EMBED':
                    $result = HappyFenceNGEmbedProps::get_instance();
                    break;
                case 'FILESYSTEM':
                    break;
                case 'GEOIP':
                    break;
                case 'LOGIN':
                    break;
                case 'LOGINENUM':
                    $result = HappyFenceNGLoginEnumProps::get_instance();
                    break;
                case 'LOGS':
                case 'SYSLOG':
                    $result = HappyFenceNGLogsProps::get_instance();
                    break;
                case 'META':
                    $result = HappyFenceNGMetaProps::get_instance();
                    break;
                case 'MFA':
                    break;
                case 'PINGBACK':
                    $result = HappyFenceNGPingbackProps::get_instance();
                    break;
                case 'PF':
                    break;
                case 'PRIVACY':
                    $result = HappyFenceNGPrivacyProps::get_instance();
                    break;
                case 'RESCAN':
                    break;
                case 'REST':
                    break;
                case 'ROBOTS':
                case 'SEO':
                    break;
                case 'SUSPICIOUSQUERY':
                    break;
                case 'UG':
                    break;
                case 'XMLRPC':
                    $result = HappyFenceNGXMLRPCProps::get_instance();
                    break;
                case 'PCORE':
                    $result = HappyFenceNGPcoreProps::get_instance();
                    break;
                case 'CANONICAL':
                    $result = self::$c_a_n_o_n_i_c_a_l;
                    break;
                case 'EXECCHAIN':
                    $result = HappyFenceNGExecChain::get_instance();
                    break;
                default:
                    HappyFenceNGLOGCORE::logcore( static::class . "Unknown property (???) -> {$property}", HappyFenceNGSyslogFacility::INIT, HappyFenceNGSyslogSeverity::ERROR );
                    $result = HappyFenceNGMulti::get_instance();
            }
            return $result;
        } catch ( \Throwable $e ) {
            HappyFenceNGLOGCORE::logcore( static::class . 'EXCEPTION -> ' . $e->getMessage(), HappyFenceNGSyslogFacility::INIT, HappyFenceNGSyslogSeverity::ERROR );
            return HappyFenceNGMulti::get_instance();
        }
    }

}
