1 | <?php |
||
36 | class Cache |
||
37 | { |
||
38 | /** |
||
39 | * type of cache (memcache/file) |
||
40 | * |
||
41 | * @access private |
||
42 | * @var string |
||
43 | */ |
||
44 | private static $_sTypeOfCache = 'file'; |
||
45 | |||
46 | /** |
||
47 | * type of cache (memcache/file) |
||
48 | * |
||
49 | * @access private |
||
50 | * @var array |
||
51 | */ |
||
52 | private static $_aCache = array(); |
||
53 | |||
54 | /** |
||
55 | * set the cache that we would use |
||
56 | * |
||
57 | * @access private |
||
58 | * @param string $sCacheName name of cache |
||
59 | * @return object |
||
60 | */ |
||
61 | public static function setCacheType(string $sCacheName) |
||
69 | |||
70 | /** |
||
71 | * set a value |
||
72 | * |
||
73 | * @access public |
||
74 | * @param string $sName name of the session |
||
75 | * @param mixed $mValue value of this sesion var |
||
76 | * @param int $iFlag unused |
||
77 | * @param int $iExpire expiration of cache |
||
78 | * @return void |
||
79 | */ |
||
80 | public static function set(string $sName, $mValue, int $iFlag = 0, int $iExpire = 0) |
||
84 | |||
85 | /** |
||
86 | * get a value |
||
87 | * |
||
88 | * @access public |
||
89 | * @param string $sName name of the session |
||
90 | * @param int $iFlags flags |
||
91 | * @param int $iTimeout expiration of cache |
||
92 | * @return bool |
||
93 | */ |
||
94 | public static function get(string $sName, int &$iFlags = null, int $iTimeout = 0) : bool |
||
98 | |||
99 | /** |
||
100 | * delete a value |
||
101 | * |
||
102 | * @access public |
||
103 | * @param string $sName name of the session |
||
104 | * @return boolean |
||
105 | */ |
||
106 | public static function delete(string $sName) : bool |
||
110 | |||
111 | /** |
||
112 | * flush the cache |
||
113 | * |
||
114 | * @access public |
||
115 | * @return boolean |
||
116 | */ |
||
117 | public static function flush() : bool |
||
121 | |||
122 | /** |
||
123 | * initialize the cache class and get the good object |
||
124 | * |
||
125 | * @access private |
||
126 | * @return object |
||
127 | */ |
||
128 | private static function _getCacheObject() |
||
176 | } |
||
177 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.