Total Complexity | 6 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
26 | class RefreshListener extends AccessControlledListener |
||
27 | { |
||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | 1 | public static function getSubscribedEvents(): array |
|
32 | { |
||
33 | return [ |
||
34 | 1 | Events::PRE_HANDLE => 'handleRefresh', |
|
35 | ]; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Look at cacheable requests and handle refresh requests. |
||
40 | * |
||
41 | * When the request comes from a non-authorized client, ignore refresh to |
||
42 | * let normal lookup happen. |
||
43 | */ |
||
44 | 6 | public function handleRefresh(CacheEvent $event) |
|
61 | ); |
||
62 | 1 | } |
|
64 |
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. Please note the @ignore annotation hint above.