1 | <?php |
||
11 | class Cache { |
||
12 | |||
13 | /** |
||
14 | * Connection to a set of memcache servers |
||
15 | * |
||
16 | * @var Memcache |
||
17 | */ |
||
18 | public static $server = null; |
||
19 | |||
20 | /** |
||
21 | * Truing to connect flag |
||
22 | * |
||
23 | * @var boolean |
||
24 | */ |
||
25 | public static $connectTrying = false; |
||
26 | |||
27 | /** |
||
28 | * Connected flag |
||
29 | * |
||
30 | * @var boolean |
||
31 | */ |
||
32 | public static $connected = false; |
||
33 | |||
34 | /** |
||
35 | * Try connect to memcache server |
||
36 | */ |
||
37 | public static function connect() { |
||
44 | |||
45 | /** |
||
46 | * Get chached value |
||
47 | * |
||
48 | * If value not present, call callback |
||
49 | * |
||
50 | * @param string $name |
||
51 | * @param array $params |
||
52 | * @param callable $callback |
||
53 | * @return boolean |
||
54 | */ |
||
55 | public static function get($name, $params = [], $callback = null, $lifeTime = 3600, $prefix = false) { |
||
89 | |||
90 | /** |
||
91 | * Set value to cache |
||
92 | * |
||
93 | * @param string $name |
||
94 | * @param array $params |
||
95 | * @param mixed $val |
||
96 | * @param int $lifeTime |
||
97 | * @return boolean |
||
98 | */ |
||
99 | public static function set($name, $params = [], $val = '', $lifeTime = 3600, $prefix = false) { |
||
111 | |||
112 | /** |
||
113 | * Move file to cache folder and return path |
||
114 | * |
||
115 | * Also resize image when given resize params |
||
116 | * |
||
117 | * @param string $file |
||
118 | * @param array $options |
||
119 | * @return string |
||
120 | */ |
||
121 | public static function file($file, $options = []) { |
||
141 | |||
142 | /** |
||
143 | * Get cache dir for app |
||
144 | * |
||
145 | * @param App $app |
||
146 | * @return string |
||
147 | */ |
||
148 | public static function getDir($dirname, $app = null) { |
||
156 | |||
157 | public static function folder() { |
||
160 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.