Valinor/qa/PHPStan/Stubs/Psr/SimpleCache/CacheInterface.stub

44 lines
945 B
PHP
Raw Normal View History

2021-11-28 17:43:02 +01:00
<?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;
}