diff --git a/system/Helpers/array_helper.php b/system/Helpers/array_helper.php index b8bd1a4d956f..4c1477f57d4a 100644 --- a/system/Helpers/array_helper.php +++ b/system/Helpers/array_helper.php @@ -72,12 +72,8 @@ function _array_search_dot(array $indexes, array $array) $answer = array_filter($answer, static fn ($value) => $value !== null); if ($answer !== []) { - if (count($answer) === 1) { - // If array only has one element, we return that element for BC. - return current($answer); - } - - return $answer; + // If array only has one element, we return that element for BC. + return count($answer) === 1 ? current($answer) : $answer; } return null; diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php index d3abd7e247b0..b8ad34770464 100644 --- a/system/Helpers/form_helper.php +++ b/system/Helpers/form_helper.php @@ -656,13 +656,7 @@ function set_radio(string $field, string $value = '', bool $default = false): st $postInput = $request->getPost($field); - if ($oldInput !== null) { - $input = $oldInput; - } elseif ($postInput !== null) { - $input = $postInput; - } else { - $input = $default; - } + $input = $oldInput ?? $postInput ?? $default; if (is_array($input)) { // Note: in_array('', array(0)) returns TRUE, do not use it diff --git a/system/Helpers/html_helper.php b/system/Helpers/html_helper.php index 075dcd510b43..0f7e154a02bf 100755 --- a/system/Helpers/html_helper.php +++ b/system/Helpers/html_helper.php @@ -70,9 +70,9 @@ function _list(string $type = 'ul', $list = [], $attributes = '', int $depth = 0 $out .= $val; } else { $out .= $key - . "\n" - . _list($type, $val, '', $depth + 4) - . str_repeat(' ', $depth + 2); + . "\n" + . _list($type, $val, '', $depth + 4) + . str_repeat(' ', $depth + 2); } $out .= "\n";