<?php
/**
 * Main plugin bootstrap.
 *
 * @package BatoCookieConsent
 */

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

final class Bato_Cookie_Consent_Plugin
{
    private static ?Bato_Cookie_Consent_Plugin $instance = null;

    public static function instance(): Bato_Cookie_Consent_Plugin
    {
        if (null === self::$instance) {
            self::$instance = new self();
        }

        return self::$instance;
    }

    public function init(): void
    {
        $settings = new Bato_Cookie_Consent_Settings();

        (new Bato_Cookie_Consent_Admin($settings))->init();
        (new Bato_Cookie_Consent_REST_Controller($settings))->init();
        (new Bato_Cookie_Consent_Frontend($settings))->init();
    }
}
