<?php
/**
 * BookiFlex Core
 *
 * @package    BookiFlex
 * @subpackage Core
 * @author     BookiFlex
 * @copyright  Copyright (c) 2025 BookiFlex
 * @license    GPL-2.0-or-later
 *
 * @link       https://bookiflex.com
 */

declare(strict_types=1);

namespace BookiFlex\Core\Infrastructure\Storage;

defined( 'ABSPATH' ) || exit;

/**
 * Repository interface for persistent options storage.
 *
 * Provides abstraction over WordPress options API for storing
 * permanent configuration and state data.
 */
interface OptionRepositoryInterface
{
    /**
     * Get an option value.
     *
     * @param string $key Option key (will be prefixed automatically)
     * @param mixed $default Default value if option doesn't exist
     * @return mixed Option value or default
     */
    public function get(string $key, mixed $default = null): mixed;

    /**
     * Set an option value.
     *
     * @param string $key Option key (will be prefixed automatically)
     * @param mixed $value Value to store
     * @return bool True on success, false on failure
     */
    public function set(string $key, mixed $value): bool;

    /**
     * Delete an option.
     *
     * @param string $key Option key (will be prefixed automatically)
     * @return bool True on success, false on failure
     */
    public function delete(string $key): bool;

    /**
     * Check if an option exists.
     *
     * @param string $key Option key (will be prefixed automatically)
     * @return bool True if option exists, false otherwise
     */
    public function has(string $key): bool;
}
