1 | <?php |
||
27 | class CacheCollector extends DataCollector |
||
28 | { |
||
29 | /** |
||
30 | * @var \Phpfastcache\Bundle\Service\Phpfastcache |
||
31 | */ |
||
32 | private $cache; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $twig_cache_blocks = []; |
||
38 | |||
39 | /** |
||
40 | * CacheCollector constructor. |
||
41 | * |
||
42 | * @param \Phpfastcache\Bundle\Service\Phpfastcache $cache |
||
43 | */ |
||
44 | public function __construct(Phpfastcache $cache) |
||
48 | |||
49 | /** |
||
50 | * @param \Symfony\Component\HttpFoundation\Request $request |
||
51 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
52 | * @param \Exception|null $exception |
||
53 | */ |
||
54 | public function collect(Request $request, Response $response, \Exception $exception = null) |
||
99 | |||
100 | /** |
||
101 | * @return mixed |
||
102 | */ |
||
103 | public function getStats() |
||
107 | |||
108 | /** |
||
109 | * @return mixed |
||
110 | */ |
||
111 | public function getInstances() |
||
115 | |||
116 | /** |
||
117 | * @return mixed |
||
118 | */ |
||
119 | public function getDriverUsed() |
||
123 | |||
124 | /** |
||
125 | * @return mixed |
||
126 | */ |
||
127 | public function getHits() |
||
131 | |||
132 | /** |
||
133 | * @return mixed |
||
134 | */ |
||
135 | public function getSize() |
||
139 | |||
140 | /** |
||
141 | * @return mixed |
||
142 | */ |
||
143 | public function getCoreConfig() |
||
147 | |||
148 | /** |
||
149 | * @return mixed |
||
150 | */ |
||
151 | public function getProjectConfig() |
||
155 | |||
156 | /** |
||
157 | * @return mixed |
||
158 | */ |
||
159 | public function getApiVersion() |
||
163 | |||
164 | /** |
||
165 | * @return mixed |
||
166 | */ |
||
167 | public function getPfcVersion() |
||
171 | |||
172 | /** |
||
173 | * @return mixed |
||
174 | */ |
||
175 | public function getBundleVersion() |
||
179 | |||
180 | /** |
||
181 | * @return mixed |
||
182 | */ |
||
183 | public function getApiChangelog() |
||
187 | |||
188 | /** |
||
189 | * @param string $blockName |
||
190 | * @param array $cacheBlock |
||
191 | * @return $this |
||
192 | */ |
||
193 | public function setTwigCacheBlock($blockName, array $cacheBlock) |
||
204 | |||
205 | /** |
||
206 | * @return array |
||
207 | */ |
||
208 | public function getTwigCacheBlocks() |
||
212 | |||
213 | /** |
||
214 | * @return string |
||
215 | */ |
||
216 | public function getName() |
||
220 | |||
221 | public function reset() |
||
225 | } |
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.