[web-php] master: Enhancement: Enable `elseif` fixer (#859)
| From: | Andreas Möller via GitHub | Date: | Wed, 06 Dec 2023 13:59:16 +0000 |
| Subject: | [web-php] master: Enhancement: Enable `elseif` fixer (#859) | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-31170@lists.php.net to get a copy of this message | ||
Author: Andreas Möller (localheinz)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2023-12-06T14:45:36+01:00
Commit: https://github.com/php/web-php/commit/269cfd55c0ac549893cca90b4b14df41a4f8bac4
Raw diff: https://github.com/php/web-php/commit/269cfd55c0ac549893cca90b4b14df41a4f8bac4.diff
Enhancement: Enable
elseif fixer (#859)
Changed paths:
M .php-cs-fixer.php
M include/layout.inc
Diff:
diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index 542a8c71bd..2d03dc7008 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -28,6 +28,7 @@
'spacing' => 'one',
],
'constant_case' => true,
+ 'elseif' => true,
'increment_style' => [
'style' => 'post',
],
diff --git a/include/layout.inc b/include/layout.inc
index 563ed8bade..dcbc720293 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -212,9 +212,9 @@ function sect_to_file($string) {
$feat = "features.$string.php";
$struct = "control-structures.$string.php";
if (@is_file($func)) return $func;
- else if (@is_file($chap)) return $chap;
- else if (@is_file($feat)) return $feat;
- else if (@is_file($struct)) return $struct;
+ elseif (@is_file($chap)) return $chap;
+ elseif (@is_file($feat)) return $feat;
+ elseif (@is_file($struct)) return $struct;
else return "$string.php";
}