# auto-alt-text/trunk/src/App/Infrastructure/Cache/CacheInterface.php

Auto Alt Text, version trunk. 39 lines.

- Page: https://pluginprobe.com/plugins/auto-alt-text/trunk/code/src/App/Infrastructure/Cache/CacheInterface.php
- Raw: https://pluginprobe.com/plugins/auto-alt-text/trunk/raw/src/App/Infrastructure/Cache/CacheInterface.php
- Modified: 2026-06-03T12:19:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/auto-alt-text/trunk/code/src/App/Infrastructure/Cache/CacheInterface.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace AATXT\App\Infrastructure\Cache;

/**
 * Minimal cache abstraction for short-lived key/value storage.
 *
 * Implementations wrap a backing store (e.g. WordPress transients) and allow
 * dependency injection so consumers can be unit-tested without WordPress.
 */
interface CacheInterface
{
    /**
     * Retrieve a value from the cache.
     *
     * @param string $key
     * @return mixed|null Null when the key is missing.
     */
    public function get(string $key);

    /**
     * Store a value in the cache.
     *
     * @param string $key
     * @param mixed  $value
     * @param int    $ttl Time-to-live in seconds.
     */
    public function set(string $key, $value, int $ttl): void;

    /**
     * Remove a value from the cache.
     *
     * @param string $key
     */
    public function delete(string $key): void;
}

```
