?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin/Controllers/



?? Go up: /home/webdevt/www/demo2/wp-content/plugins/divi-contact-form-helper/d5/server/Admin

?? Viewing: SettingsRepository.php

<?php

namespace KS_PAC_DCFH\Admin\Controllers;

class SettingsRepository
{
    private static ?self $_instance = null;

    private array $settings;

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

        return self::$_instance;
    }

    private function __construct()
    {
        $settings = get_option(KS_PAC_DCFH_SETTINGS_OPTION);
        $this->settings = is_array($settings) ? $settings : [];

    }

    public function get_setting(string $key, $default = null)
    {
        return $this->settings[$key] ?? $default;
    }

    public function is_setting_enabled(string $key, bool $default = false): bool
    {
        return isset($this->settings[$key])
            ? (bool)$this->settings[$key]
            : $default;
    }

    public function get_all_settings(): array
    {
        return $this->settings;
    }

    public function is_multilingual_enabled(): bool
    {
        return $this->is_setting_enabled('is_custom_text_multilingual_enabled');
    }
}


??

??