Skip to content

Commit 8727ab9

Browse files
refactor(php74): use null coalescing (??) and ??= operators
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
1 parent 5cc7cd4 commit 8727ab9

5 files changed

Lines changed: 146 additions & 150 deletions

File tree

includes/arrays.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@
268268
$default_priority = LOG_WARNING;
269269
}
270270

271-
if (!isset($step)) {
272-
$step = read_config_option('poller_interval');
273-
}
271+
$step ??= read_config_option('poller_interval');
274272

275273
switch($step) {
276274
case '10':

notify_lists.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ function form_actions() {
842842

843843
bottom_footer();
844844
} else {
845-
$save = ['post' => $_POST, 'selected_items' => isset($selected_items) ? $selected_items : ''];
845+
$save = ['post' => $_POST, 'selected_items' => $selected_items ?? ''];
846846
api_plugin_hook_function('notify_list_form_confirm', $save);
847847
}
848848
}
@@ -974,7 +974,7 @@ function edit() {
974974
draw_edit_form(
975975
[
976976
'config' => [],
977-
'fields' => inject_form_variables($fields_notification, (isset($list) ? $list : []))
977+
'fields' => inject_form_variables($fields_notification, ($list ?? []))
978978
]
979979
);
980980

0 commit comments

Comments
 (0)