Skip to content

Commit ec908ce

Browse files
authored
Enhancement: Enable no_superfluous_elseif fixer (#884)
1 parent faf2e75 commit ec908ce

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'no_extra_blank_lines' => true,
4343
'no_mixed_echo_print' => true,
4444
'no_singleline_whitespace_before_semicolons' => true,
45+
'no_superfluous_elseif' => true,
4546
'no_trailing_whitespace' => true,
4647
'ordered_class_elements' => true,
4748
'random_api_migration' => true,

include/layout.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ function sect_to_file($string) {
212212
$feat = "features.$string.php";
213213
$struct = "control-structures.$string.php";
214214
if (@is_file($func)) return $func;
215-
elseif (@is_file($chap)) return $chap;
216-
elseif (@is_file($feat)) return $feat;
217-
elseif (@is_file($struct)) return $struct;
215+
if (@is_file($chap)) return $chap;
216+
if (@is_file($feat)) return $feat;
217+
if (@is_file($struct)) return $struct;
218218
else return "$string.php";
219219
}
220220

0 commit comments

Comments
 (0)