mirror of
https://github.com/danog/Valinor.git
synced 2024-12-11 16:49:51 +01:00
44 lines
945 B
PHP
44 lines
945 B
PHP
|
<?php
|
||
|
|
||
|
namespace Psr\SimpleCache;
|
||
|
|
||
|
use DateInterval;
|
||
|
|
||
|
/**
|
||
|
* @template EntryType
|
||
|
*/
|
||
|
interface CacheInterface
|
||
|
{
|
||
|
/**
|
||
|
* @param string $key
|
||
|
* @param EntryType $default
|
||
|
* @return EntryType
|
||
|
*/
|
||
|
public function get(string $key, $default = null);
|
||
|
|
||
|
/**
|
||
|
* @param string $key
|
||
|
* @param EntryType $value
|
||
|
* @param null|int|DateInterval $ttl
|
||
|
*/
|
||
|
public function set(string $key, $value, $ttl = null): bool;
|
||
|
|
||
|
/**
|
||
|
* @param iterable<string> $keys
|
||
|
* @param EntryType $default
|
||
|
* @return iterable<string, EntryType>
|
||
|
*/
|
||
|
public function getMultiple(iterable $keys, $default = null): iterable;
|
||
|
|
||
|
/**
|
||
|
* @param iterable<string, EntryType> $values
|
||
|
* @param null|int|DateInterval $ttl
|
||
|
*/
|
||
|
public function setMultiple(iterable $values, $ttl = null): bool;
|
||
|
|
||
|
/**
|
||
|
* @param iterable<string> $keys
|
||
|
*/
|
||
|
public function deleteMultiple(iterable $keys): bool;
|
||
|
}
|