Passed
Push — master ( f13f78...5c1b24 )
by Ismayil
04:22
created

actions/admin/site/set_maintenance_mode.php (1 issue)

Upgrade to new PHP Analysis Engine

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
The call to elgg_save_config() has too many arguments starting with null.

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.

Loading history...
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