-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathCache.stub
82 lines (68 loc) · 1.66 KB
/
Cache.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
namespace Nette\Caching;
use Nette\InvalidArgumentException;
/**
* @phpstan-type cache-dependencies array{ priority?: int, expire?: string|int|\DateTimeInterface, sliding?: mixed, tags?: list<string>, files?: list<string>, items?: list<string>, const?: list<string>|string, callbacks?: list<array{0: (callable(): bool)}&array<mixed>>, namespaces?: list<string> }
* @phpstan-type clean-conditions array{ priority?: int, tags?: list<string>, all?: true }
*/
class Cache
{
/**
* @template T
* @param mixed $key
* @param (callable(cache-dependencies &$dependencies): T)|null $generator
* @return T
*/
public function load($key, callable $generator = null)
{
// nothing
}
/**
* @template T of array
* @param array<mixed> $key
* @param (callable(mixed, cache-dependencies &$dependencies): T)|null $generator
* @return T
*/
public function bulkLoad($key, callable $generator = null)
{
// nothing
}
/**
* @template T
* @param mixed $key
* @param T $data
* @param cache-dependencies|null $dependencies
* @return T
* @throws InvalidArgumentException
*/
public function save($key, $data, array $dependencies = null)
{
// nothing
}
/**
* @param clean-conditions|null $conditions
*/
public function clean(array $conditions = null): void
{
// nothing
}
/**
* @template T
* @param (callable(): T) $function
* @return T
*/
public function call(callable $function)
{
// nothing
}
/**
* @template T
* @param (callable(): T) $function
* @param cache-dependencies|null $dependencies
* @return (\Closure(): T)
*/
public function wrap(callable $function, array $dependencies = null): \Closure
{
// nothing
}
}