<?php

declare(strict_types=1);

namespace Instinctor\Core\Config;

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

/**
 * WordPressDriver — delegates to get_option / update_option / delete_option.
 *
 * No state stored on the instance. Each call goes directly to WP functions,
 * which themselves handle caching (wp_cache) internally.
 */
final class WordPressDriver implements DriverInterface
{
    public function get(string $key, mixed $default = false): mixed
    {
        return get_option($key, $default);
    }

    public function set(string $key, mixed $value): bool
    {
        return update_option($key, $value);
    }

    public function delete(string $key): bool
    {
        return delete_option($key);
    }
}
