Null coalescing operator can be used

Signed-off-by: Yuriy Pikhtarev <iglix@me.com>
This commit is contained in:
Yuriy Pikhtarev 2018-06-24 15:18:35 +03:00
commit f0d6d30def
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
27 changed files with 60 additions and 61 deletions

View file

@ -14,11 +14,11 @@ if (!empty($setmodules)) {
return;
}
$mode = isset($_GET['mode']) ? $_GET['mode'] : '';
$mode = $_GET['mode'] ?? '';
$job_id = isset($_GET['id']) ? (int)$_GET['id'] : '';
$submit = isset($_POST['submit']);
$jobs = isset($_POST['select']) ? implode(',', $_POST['select']) : '';
$cron_action = isset($_POST['cron_action']) ? $_POST['cron_action'] : '';
$cron_action = $_POST['cron_action'] ?? '';
if ($mode == 'run' && !$job_id) {
define('BB_ROOT', './../');
@ -40,7 +40,7 @@ foreach ($sql as $row) {
$config_value = $row['config_value'];
$default_config[$config_name] = $config_value;
$new[$config_name] = isset($_POST[$config_name]) ? $_POST[$config_name] : $default_config[$config_name];
$new[$config_name] = $_POST[$config_name] ?? $default_config[$config_name];
if (isset($_POST['submit']) && $row['config_value'] != $new[$config_name]) {
bb_update_config(array($config_name => $new[$config_name]));