| 1 | <?php |
||
| 19 | class Psr16Storage implements Storage |
||
| 20 | { |
||
| 21 | private const DEFAULT_REMEMBER_TIME = 60 * 5; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | private $timeout; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var CacheInterface |
||
| 30 | */ |
||
| 31 | private $storage; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Psr16Storage constructor. |
||
| 35 | * @param CacheInterface $storage |
||
| 36 | * @param int $timeout |
||
| 37 | */ |
||
| 38 | public function __construct(CacheInterface $storage, int $timeout = self::DEFAULT_REMEMBER_TIME) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param Readable $readable |
||
| 46 | * @param \Closure $then |
||
| 47 | * @return mixed |
||
| 48 | * @throws \Exception |
||
| 49 | * @throws \Psr\SimpleCache\InvalidArgumentException |
||
| 50 | */ |
||
| 51 | public function remember(Readable $readable, \Closure $then) |
||
| 66 | } |
||
| 67 |