@@ -303,7 +303,7 @@ public function __set(string $name, $value)
303303
304304 if (is_int ($ value ) === true ) {
305305 $ value = abs ($ value );
306- } else if (is_string ($ value ) === true && preg_match ('`^\d+$` ' , $ value ) === 1 ) {
306+ } elseif (is_string ($ value ) === true && preg_match ('`^\d+$` ' , $ value ) === 1 ) {
307307 $ value = (int ) $ value ;
308308 } else {
309309 $ value = self ::DEFAULT_REPORT_WIDTH ;
@@ -920,14 +920,14 @@ public function processLongArgument(string $arg, int $pos)
920920
921921 $ this ->sniffs = $ this ->parseSniffCodes (substr ($ arg , 7 ), 'sniffs ' );
922922 $ this ->overriddenDefaults ['sniffs ' ] = true ;
923- } else if (substr ($ arg , 0 , 8 ) === 'exclude= ' ) {
923+ } elseif (substr ($ arg , 0 , 8 ) === 'exclude= ' ) {
924924 if (isset ($ this ->overriddenDefaults ['exclude ' ]) === true ) {
925925 break ;
926926 }
927927
928928 $ this ->exclude = $ this ->parseSniffCodes (substr ($ arg , 8 ), 'exclude ' );
929929 $ this ->overriddenDefaults ['exclude ' ] = true ;
930- } else if (substr ($ arg , 0 , 6 ) === 'cache= ' ) {
930+ } elseif (substr ($ arg , 0 , 6 ) === 'cache= ' ) {
931931 if ((isset ($ this ->overriddenDefaults ['cache ' ]) === true
932932 && $ this ->cache === false )
933933 || isset ($ this ->overriddenDefaults ['cacheFile ' ]) === true
@@ -977,7 +977,7 @@ public function processLongArgument(string $arg, int $pos)
977977 $ error .= $ this ->printShortUsage (true );
978978 throw new DeepExitException ($ error , ExitCode::PROCESS_ERROR );
979979 }
980- } else if (substr ($ arg , 0 , 10 ) === 'bootstrap= ' ) {
980+ } elseif (substr ($ arg , 0 , 10 ) === 'bootstrap= ' ) {
981981 $ files = explode (', ' , substr ($ arg , 10 ));
982982 $ bootstrap = [];
983983 foreach ($ files as $ file ) {
@@ -993,7 +993,7 @@ public function processLongArgument(string $arg, int $pos)
993993
994994 $ this ->bootstrap = array_merge ($ this ->bootstrap , $ bootstrap );
995995 $ this ->overriddenDefaults ['bootstrap ' ] = true ;
996- } else if (substr ($ arg , 0 , 10 ) === 'file-list= ' ) {
996+ } elseif (substr ($ arg , 0 , 10 ) === 'file-list= ' ) {
997997 $ fileList = substr ($ arg , 10 );
998998 $ path = Common::realpath ($ fileList );
999999 if ($ path === false ) {
@@ -1013,7 +1013,7 @@ public function processLongArgument(string $arg, int $pos)
10131013
10141014 $ this ->processFilePath ($ inputFile );
10151015 }
1016- } else if (substr ($ arg , 0 , 11 ) === 'stdin-path= ' ) {
1016+ } elseif (substr ($ arg , 0 , 11 ) === 'stdin-path= ' ) {
10171017 if (isset ($ this ->overriddenDefaults ['stdinPath ' ]) === true ) {
10181018 break ;
10191019 }
@@ -1026,7 +1026,7 @@ public function processLongArgument(string $arg, int $pos)
10261026 }
10271027
10281028 $ this ->overriddenDefaults ['stdinPath ' ] = true ;
1029- } else if (substr ($ arg , 0 , 12 ) === 'report-file= ' ) {
1029+ } elseif (substr ($ arg , 0 , 12 ) === 'report-file= ' ) {
10301030 if (PHP_CODESNIFFER_CBF === true || isset ($ this ->overriddenDefaults ['reportFile ' ]) === true ) {
10311031 break ;
10321032 }
@@ -1054,14 +1054,14 @@ public function processLongArgument(string $arg, int $pos)
10541054 $ error .= $ this ->printShortUsage (true );
10551055 throw new DeepExitException ($ error , ExitCode::PROCESS_ERROR );
10561056 }
1057- } else if (substr ($ arg , 0 , 13 ) === 'report-width= ' ) {
1057+ } elseif (substr ($ arg , 0 , 13 ) === 'report-width= ' ) {
10581058 if (isset ($ this ->overriddenDefaults ['reportWidth ' ]) === true ) {
10591059 break ;
10601060 }
10611061
10621062 $ this ->reportWidth = substr ($ arg , 13 );
10631063 $ this ->overriddenDefaults ['reportWidth ' ] = true ;
1064- } else if (substr ($ arg , 0 , 9 ) === 'basepath= ' ) {
1064+ } elseif (substr ($ arg , 0 , 9 ) === 'basepath= ' ) {
10651065 if (isset ($ this ->overriddenDefaults ['basepath ' ]) === true ) {
10661066 break ;
10671067 }
@@ -1087,7 +1087,7 @@ public function processLongArgument(string $arg, int $pos)
10871087 $ error .= $ this ->printShortUsage (true );
10881088 throw new DeepExitException ($ error , ExitCode::PROCESS_ERROR );
10891089 }
1090- } else if ((substr ($ arg , 0 , 7 ) === 'report= ' || substr ($ arg , 0 , 7 ) === 'report- ' )) {
1090+ } elseif ((substr ($ arg , 0 , 7 ) === 'report= ' || substr ($ arg , 0 , 7 ) === 'report- ' )) {
10911091 $ reports = [];
10921092
10931093 if ($ arg [6 ] === '- ' ) {
@@ -1140,21 +1140,21 @@ public function processLongArgument(string $arg, int $pos)
11401140 }
11411141
11421142 $ this ->overriddenDefaults ['reports ' ] = true ;
1143- } else if (substr ($ arg , 0 , 7 ) === 'filter= ' ) {
1143+ } elseif (substr ($ arg , 0 , 7 ) === 'filter= ' ) {
11441144 if (isset ($ this ->overriddenDefaults ['filter ' ]) === true ) {
11451145 break ;
11461146 }
11471147
11481148 $ this ->filter = substr ($ arg , 7 );
11491149 $ this ->overriddenDefaults ['filter ' ] = true ;
1150- } else if (substr ($ arg , 0 , 9 ) === 'standard= ' ) {
1150+ } elseif (substr ($ arg , 0 , 9 ) === 'standard= ' ) {
11511151 $ standards = trim (substr ($ arg , 9 ));
11521152 if ($ standards !== '' ) {
11531153 $ this ->standards = explode (', ' , $ standards );
11541154 }
11551155
11561156 $ this ->overriddenDefaults ['standards ' ] = true ;
1157- } else if (substr ($ arg , 0 , 11 ) === 'extensions= ' ) {
1157+ } elseif (substr ($ arg , 0 , 11 ) === 'extensions= ' ) {
11581158 if (isset ($ this ->overriddenDefaults ['extensions ' ]) === true ) {
11591159 break ;
11601160 }
@@ -1182,21 +1182,21 @@ public function processLongArgument(string $arg, int $pos)
11821182
11831183 $ this ->extensions = $ newExtensions ;
11841184 $ this ->overriddenDefaults ['extensions ' ] = true ;
1185- } else if (substr ($ arg , 0 , 7 ) === 'suffix= ' ) {
1185+ } elseif (substr ($ arg , 0 , 7 ) === 'suffix= ' ) {
11861186 if (isset ($ this ->overriddenDefaults ['suffix ' ]) === true ) {
11871187 break ;
11881188 }
11891189
11901190 $ this ->suffix = substr ($ arg , 7 );
11911191 $ this ->overriddenDefaults ['suffix ' ] = true ;
1192- } else if (substr ($ arg , 0 , 9 ) === 'parallel= ' ) {
1192+ } elseif (substr ($ arg , 0 , 9 ) === 'parallel= ' ) {
11931193 if (isset ($ this ->overriddenDefaults ['parallel ' ]) === true ) {
11941194 break ;
11951195 }
11961196
11971197 $ this ->parallel = max ((int ) substr ($ arg , 9 ), 1 );
11981198 $ this ->overriddenDefaults ['parallel ' ] = true ;
1199- } else if (substr ($ arg , 0 , 9 ) === 'severity= ' ) {
1199+ } elseif (substr ($ arg , 0 , 9 ) === 'severity= ' ) {
12001200 $ this ->errorSeverity = (int ) substr ($ arg , 9 );
12011201 $ this ->warningSeverity = $ this ->errorSeverity ;
12021202 if (isset ($ this ->overriddenDefaults ['errorSeverity ' ]) === false ) {
@@ -1206,21 +1206,21 @@ public function processLongArgument(string $arg, int $pos)
12061206 if (isset ($ this ->overriddenDefaults ['warningSeverity ' ]) === false ) {
12071207 $ this ->overriddenDefaults ['warningSeverity ' ] = true ;
12081208 }
1209- } else if (substr ($ arg , 0 , 15 ) === 'error-severity= ' ) {
1209+ } elseif (substr ($ arg , 0 , 15 ) === 'error-severity= ' ) {
12101210 if (isset ($ this ->overriddenDefaults ['errorSeverity ' ]) === true ) {
12111211 break ;
12121212 }
12131213
12141214 $ this ->errorSeverity = (int ) substr ($ arg , 15 );
12151215 $ this ->overriddenDefaults ['errorSeverity ' ] = true ;
1216- } else if (substr ($ arg , 0 , 17 ) === 'warning-severity= ' ) {
1216+ } elseif (substr ($ arg , 0 , 17 ) === 'warning-severity= ' ) {
12171217 if (isset ($ this ->overriddenDefaults ['warningSeverity ' ]) === true ) {
12181218 break ;
12191219 }
12201220
12211221 $ this ->warningSeverity = (int ) substr ($ arg , 17 );
12221222 $ this ->overriddenDefaults ['warningSeverity ' ] = true ;
1223- } else if (substr ($ arg , 0 , 7 ) === 'ignore= ' ) {
1223+ } elseif (substr ($ arg , 0 , 7 ) === 'ignore= ' ) {
12241224 if (isset ($ this ->overriddenDefaults ['ignored ' ]) === true ) {
12251225 break ;
12261226 }
@@ -1244,7 +1244,7 @@ public function processLongArgument(string $arg, int $pos)
12441244
12451245 $ this ->ignored = $ ignored ;
12461246 $ this ->overriddenDefaults ['ignored ' ] = true ;
1247- } else if (substr ($ arg , 0 , 10 ) === 'generator= '
1247+ } elseif (substr ($ arg , 0 , 10 ) === 'generator= '
12481248 && PHP_CODESNIFFER_CBF === false
12491249 ) {
12501250 if (isset ($ this ->overriddenDefaults ['generator ' ]) === true ) {
@@ -1268,14 +1268,14 @@ public function processLongArgument(string $arg, int $pos)
12681268
12691269 $ this ->generator = self ::VALID_GENERATORS [$ lowerCaseGeneratorName ];
12701270 $ this ->overriddenDefaults ['generator ' ] = true ;
1271- } else if (substr ($ arg , 0 , 9 ) === 'encoding= ' ) {
1271+ } elseif (substr ($ arg , 0 , 9 ) === 'encoding= ' ) {
12721272 if (isset ($ this ->overriddenDefaults ['encoding ' ]) === true ) {
12731273 break ;
12741274 }
12751275
12761276 $ this ->encoding = strtolower (substr ($ arg , 9 ));
12771277 $ this ->overriddenDefaults ['encoding ' ] = true ;
1278- } else if (substr ($ arg , 0 , 10 ) === 'tab-width= ' ) {
1278+ } elseif (substr ($ arg , 0 , 10 ) === 'tab-width= ' ) {
12791279 if (isset ($ this ->overriddenDefaults ['tabWidth ' ]) === true ) {
12801280 break ;
12811281 }
@@ -1342,9 +1342,9 @@ private function parseSniffCodes(string $input, string $argument)
13421342
13431343 if ($ partCount === 0 ) {
13441344 $ errors [] = 'Standard codes are not supported: ' . $ sniff ;
1345- } else if ($ partCount === 1 ) {
1345+ } elseif ($ partCount === 1 ) {
13461346 $ errors [] = 'Category codes are not supported: ' . $ sniff ;
1347- } else if ($ partCount === 3 ) {
1347+ } elseif ($ partCount === 3 ) {
13481348 $ errors [] = 'Message codes are not supported: ' . $ sniff ;
13491349 } else {
13501350 $ errors [] = 'Too many parts: ' . $ sniff ;
0 commit comments