<?php

declare(strict_types=1);

namespace App\Framework\Cache\Contracts;

use App\Framework\Cache\CacheDriver;

/**
 * Interface for cache implementations that can provide access to their underlying driver
 *
 * This allows proper access to driver-specific features like scanning
 * without resorting to reflection APIs.
 */
interface DriverAccessible
{
    /**
     * Get the underlying cache driver for direct access
     *
     * @return CacheDriver|null The driver, or null if not available
     */
    public function getDriver(): ?CacheDriver;

    /**
     * Check if the underlying driver supports a specific interface
     *
     * @param class-string $interface The interface to check for
     * @return bool Whether the driver implements the interface
     */
    public function driverSupports(string $interface): bool;
}
