These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Configure site maintenance mode |
||
4 | */ |
||
5 | |||
6 | $mode = (int) get_input('mode'); |
||
7 | $message = get_input('message'); |
||
8 | |||
9 | $site = elgg_get_site_entity(); |
||
10 | |||
11 | $result = elgg_save_config('elgg_maintenance_mode', $mode, null); |
||
0 ignored issues
–
show
|
|||
12 | |||
13 | $result = $result && $site->setPrivateSetting('elgg_maintenance_message', $message); |
||
14 | |||
15 | if (!$result) { |
||
16 | return elgg_error_response(elgg_echo('save:fail')); |
||
17 | } |
||
18 | |||
19 | return elgg_ok_response('', elgg_echo('admin:maintenance_mode:saved')); |
||
20 |
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.