<?php

declare(strict_types=1);

namespace CalendarPlugin\Infrastructure\WordPress;

use CalendarPlugin\Contracts\OptionsAdapterInterface;

final class WordPressOptionsAdapter implements OptionsAdapterInterface
{
    public function get(string $key, mixed $default = false): mixed
    {
        return get_option($key, $default);
    }

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

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