1 | <?php |
||
11 | trait DataCacheTrait |
||
12 | { |
||
13 | private static $dataCache = []; |
||
14 | |||
15 | /** |
||
16 | * @param array $values |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | public static function keyDataCache($values = []) |
||
28 | |||
29 | /** |
||
30 | * Get value by key. If value is not set then will be called callback |
||
31 | * |
||
32 | * @param string|array $key |
||
33 | * @param callable $callback |
||
34 | * @param bool $reset |
||
35 | * |
||
36 | * @return mixed |
||
37 | */ |
||
38 | public static function getDataCache($key, $callback, $reset = false) |
||
50 | |||
51 | /** |
||
52 | * Reset data by key |
||
53 | * |
||
54 | * @param string $key |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | public static function resetDataCache($key) |
||
66 | } |
||
67 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.