Completed
Pull Request — master (#11)
by Tomáš
03:45
created
src/Sniffs/AbstractPatternSniff.php 1 patch
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -890,26 +890,26 @@
 block discarded – undo
890 890
         $nestedBraces      = 0;
891 891
         for ($start = $from; $start >= 0; $start--) {
892 892
             switch ($pattern[$start]) {
893
-            case '(':
894
-                if ($nestedParenthesis === 0) {
895
-                    $skip['to'] = 'parenthesis_closer';
896
-                }
893
+                case '(':
894
+                    if ($nestedParenthesis === 0) {
895
+                        $skip['to'] = 'parenthesis_closer';
896
+                    }
897 897
 
898
-                $nestedParenthesis--;
899
-                break;
900
-            case '{':
901
-                if ($nestedBraces === 0) {
902
-                    $skip['to'] = 'scope_closer';
903
-                }
898
+                    $nestedParenthesis--;
899
+                    break;
900
+                case '{':
901
+                    if ($nestedBraces === 0) {
902
+                        $skip['to'] = 'scope_closer';
903
+                    }
904 904
 
905
-                $nestedBraces--;
906
-                break;
907
-            case '}':
908
-                $nestedBraces++;
909
-                break;
910
-            case ')':
911
-                $nestedParenthesis++;
912
-                break;
905
+                    $nestedBraces--;
906
+                    break;
907
+                case '}':
908
+                    $nestedBraces++;
909
+                    break;
910
+                case ')':
911
+                    $nestedParenthesis++;
912
+                    break;
913 913
             }//end switch
914 914
 
915 915
             if (isset($skip['to']) === true) {
Please login to merge, or discard this patch.
src/Files/File.php 1 patch
Switch Indentation   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -1209,88 +1209,88 @@  discard block
 block discarded – undo
1209 1209
             }
1210 1210
 
1211 1211
             switch ($this->tokens[$i]['code']) {
1212
-            case T_BITWISE_AND:
1213
-                $passByReference = true;
1214
-                break;
1215
-            case T_VARIABLE:
1216
-                $currVar = $i;
1217
-                break;
1218
-            case T_ELLIPSIS:
1219
-                $variableLength = true;
1220
-                break;
1221
-            case T_ARRAY_HINT:
1222
-            case T_CALLABLE:
1223
-                $typeHint = $this->tokens[$i]['content'];
1224
-                break;
1225
-            case T_STRING:
1226
-                // This is a string, so it may be a type hint, but it could
1227
-                // also be a constant used as a default value.
1228
-                $prevComma = false;
1229
-                for ($t = $i; $t >= $opener; $t--) {
1230
-                    if ($this->tokens[$t]['code'] === T_COMMA) {
1231
-                        $prevComma = $t;
1232
-                        break;
1212
+                case T_BITWISE_AND:
1213
+                    $passByReference = true;
1214
+                    break;
1215
+                case T_VARIABLE:
1216
+                    $currVar = $i;
1217
+                    break;
1218
+                case T_ELLIPSIS:
1219
+                    $variableLength = true;
1220
+                    break;
1221
+                case T_ARRAY_HINT:
1222
+                case T_CALLABLE:
1223
+                    $typeHint = $this->tokens[$i]['content'];
1224
+                    break;
1225
+                case T_STRING:
1226
+                    // This is a string, so it may be a type hint, but it could
1227
+                    // also be a constant used as a default value.
1228
+                    $prevComma = false;
1229
+                    for ($t = $i; $t >= $opener; $t--) {
1230
+                        if ($this->tokens[$t]['code'] === T_COMMA) {
1231
+                            $prevComma = $t;
1232
+                            break;
1233
+                        }
1233 1234
                     }
1234
-                }
1235 1235
 
1236
-                if ($prevComma !== false) {
1237
-                    $nextEquals = false;
1238
-                    for ($t = $prevComma; $t < $i; $t++) {
1239
-                        if ($this->tokens[$t]['code'] === T_EQUAL) {
1240
-                            $nextEquals = $t;
1236
+                    if ($prevComma !== false) {
1237
+                        $nextEquals = false;
1238
+                        for ($t = $prevComma; $t < $i; $t++) {
1239
+                            if ($this->tokens[$t]['code'] === T_EQUAL) {
1240
+                                $nextEquals = $t;
1241
+                                break;
1242
+                            }
1243
+                        }
1244
+
1245
+                        if ($nextEquals !== false) {
1241 1246
                             break;
1242 1247
                         }
1243 1248
                     }
1244 1249
 
1245
-                    if ($nextEquals !== false) {
1246
-                        break;
1250
+                    if ($defaultStart === null) {
1251
+                        $typeHint .= $this->tokens[$i]['content'];
1252
+                    }
1253
+                    break;
1254
+                case T_NS_SEPARATOR:
1255
+                    // Part of a type hint or default value.
1256
+                    if ($defaultStart === null) {
1257
+                        $typeHint .= $this->tokens[$i]['content'];
1258
+                    }
1259
+                    break;
1260
+                case T_CLOSE_PARENTHESIS:
1261
+                case T_COMMA:
1262
+                    // If it's null, then there must be no parameters for this
1263
+                    // method.
1264
+                    if ($currVar === null) {
1265
+                        continue;
1247 1266
                     }
1248
-                }
1249
-
1250
-                if ($defaultStart === null) {
1251
-                    $typeHint .= $this->tokens[$i]['content'];
1252
-                }
1253
-                break;
1254
-            case T_NS_SEPARATOR:
1255
-                // Part of a type hint or default value.
1256
-                if ($defaultStart === null) {
1257
-                    $typeHint .= $this->tokens[$i]['content'];
1258
-                }
1259
-                break;
1260
-            case T_CLOSE_PARENTHESIS:
1261
-            case T_COMMA:
1262
-                // If it's null, then there must be no parameters for this
1263
-                // method.
1264
-                if ($currVar === null) {
1265
-                    continue;
1266
-                }
1267 1267
 
1268
-                $vars[$paramCount]         = array();
1269
-                $vars[$paramCount]['name'] = $this->tokens[$currVar]['content'];
1268
+                    $vars[$paramCount]         = array();
1269
+                    $vars[$paramCount]['name'] = $this->tokens[$currVar]['content'];
1270 1270
 
1271
-                if ($defaultStart !== null) {
1272
-                    $vars[$paramCount]['default']
1273
-                        = $this->getTokensAsString(
1274
-                            $defaultStart,
1275
-                            ($i - $defaultStart)
1276
-                        );
1277
-                }
1271
+                    if ($defaultStart !== null) {
1272
+                        $vars[$paramCount]['default']
1273
+                            = $this->getTokensAsString(
1274
+                                $defaultStart,
1275
+                                ($i - $defaultStart)
1276
+                            );
1277
+                    }
1278 1278
 
1279
-                $vars[$paramCount]['pass_by_reference'] = $passByReference;
1280
-                $vars[$paramCount]['variable_length']   = $variableLength;
1281
-                $vars[$paramCount]['type_hint']         = $typeHint;
1279
+                    $vars[$paramCount]['pass_by_reference'] = $passByReference;
1280
+                    $vars[$paramCount]['variable_length']   = $variableLength;
1281
+                    $vars[$paramCount]['type_hint']         = $typeHint;
1282 1282
 
1283
-                // Reset the vars, as we are about to process the next parameter.
1284
-                $defaultStart    = null;
1285
-                $passByReference = false;
1286
-                $variableLength  = false;
1287
-                $typeHint        = '';
1283
+                    // Reset the vars, as we are about to process the next parameter.
1284
+                    $defaultStart    = null;
1285
+                    $passByReference = false;
1286
+                    $variableLength  = false;
1287
+                    $typeHint        = '';
1288 1288
 
1289
-                $paramCount++;
1290
-                break;
1291
-            case T_EQUAL:
1292
-                $defaultStart = ($i + 1);
1293
-                break;
1289
+                    $paramCount++;
1290
+                    break;
1291
+                case T_EQUAL:
1292
+                    $defaultStart = ($i + 1);
1293
+                    break;
1294 1294
             }//end switch
1295 1295
         }//end for
1296 1296
 
@@ -1352,27 +1352,27 @@  discard block
 block discarded – undo
1352 1352
             }
1353 1353
 
1354 1354
             switch ($this->tokens[$i]['code']) {
1355
-            case T_PUBLIC:
1356
-                $scope          = 'public';
1357
-                $scopeSpecified = true;
1358
-                break;
1359
-            case T_PRIVATE:
1360
-                $scope          = 'private';
1361
-                $scopeSpecified = true;
1362
-                break;
1363
-            case T_PROTECTED:
1364
-                $scope          = 'protected';
1365
-                $scopeSpecified = true;
1366
-                break;
1367
-            case T_ABSTRACT:
1368
-                $isAbstract = true;
1369
-                break;
1370
-            case T_FINAL:
1371
-                $isFinal = true;
1372
-                break;
1373
-            case T_STATIC:
1374
-                $isStatic = true;
1375
-                break;
1355
+                case T_PUBLIC:
1356
+                    $scope          = 'public';
1357
+                    $scopeSpecified = true;
1358
+                    break;
1359
+                case T_PRIVATE:
1360
+                    $scope          = 'private';
1361
+                    $scopeSpecified = true;
1362
+                    break;
1363
+                case T_PROTECTED:
1364
+                    $scope          = 'protected';
1365
+                    $scopeSpecified = true;
1366
+                    break;
1367
+                case T_ABSTRACT:
1368
+                    $isAbstract = true;
1369
+                    break;
1370
+                case T_FINAL:
1371
+                    $isFinal = true;
1372
+                    break;
1373
+                case T_STATIC:
1374
+                    $isStatic = true;
1375
+                    break;
1376 1376
             }//end switch
1377 1377
         }//end for
1378 1378
 
@@ -1462,21 +1462,21 @@  discard block
 block discarded – undo
1462 1462
             }
1463 1463
 
1464 1464
             switch ($this->tokens[$i]['code']) {
1465
-            case T_PUBLIC:
1466
-                $scope          = 'public';
1467
-                $scopeSpecified = true;
1468
-                break;
1469
-            case T_PRIVATE:
1470
-                $scope          = 'private';
1471
-                $scopeSpecified = true;
1472
-                break;
1473
-            case T_PROTECTED:
1474
-                $scope          = 'protected';
1475
-                $scopeSpecified = true;
1476
-                break;
1477
-            case T_STATIC:
1478
-                $isStatic = true;
1479
-                break;
1465
+                case T_PUBLIC:
1466
+                    $scope          = 'public';
1467
+                    $scopeSpecified = true;
1468
+                    break;
1469
+                case T_PRIVATE:
1470
+                    $scope          = 'private';
1471
+                    $scopeSpecified = true;
1472
+                    break;
1473
+                case T_PROTECTED:
1474
+                    $scope          = 'protected';
1475
+                    $scopeSpecified = true;
1476
+                    break;
1477
+                case T_STATIC:
1478
+                    $isStatic = true;
1479
+                    break;
1480 1480
             }
1481 1481
         }//end for
1482 1482
 
@@ -1530,13 +1530,13 @@  discard block
 block discarded – undo
1530 1530
             }
1531 1531
 
1532 1532
             switch ($this->tokens[$i]['code']) {
1533
-            case T_ABSTRACT:
1534
-                $isAbstract = true;
1535
-                break;
1533
+                case T_ABSTRACT:
1534
+                    $isAbstract = true;
1535
+                    break;
1536 1536
 
1537
-            case T_FINAL:
1538
-                $isFinal = true;
1539
-                break;
1537
+                case T_FINAL:
1538
+                    $isFinal = true;
1539
+                    break;
1540 1540
             }
1541 1541
         }//end for
1542 1542
 
Please login to merge, or discard this patch.
src/Runner.php 1 patch
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -607,19 +607,19 @@
 block discarded – undo
607 607
                 $input = trim($input);
608 608
 
609 609
                 switch ($input) {
610
-                case 's':
611
-                    break(2);
612
-                case 'q':
613
-                    exit(0);
614
-                default:
615
-                    // Repopulate the sniffs because some of them save their state
616
-                    // and only clear it when the file changes, but we are rechecking
617
-                    // the same file.
618
-                    $file->ruleset->populateTokenListeners();
619
-                    $file->reloadContent();
620
-                    $file->process();
621
-                    $this->reporter->cacheFileReport($file, $this->config);
622
-                    break;
610
+                    case 's':
611
+                        break(2);
612
+                    case 'q':
613
+                        exit(0);
614
+                    default:
615
+                        // Repopulate the sniffs because some of them save their state
616
+                        // and only clear it when the file changes, but we are rechecking
617
+                        // the same file.
618
+                        $file->ruleset->populateTokenListeners();
619
+                        $file->reloadContent();
620
+                        $file->process();
621
+                        $this->reporter->cacheFileReport($file, $this->config);
622
+                        break;
623 623
                 }
624 624
             }//end while
625 625
         }//end if
Please login to merge, or discard this patch.
src/Util/Common.php 1 patch
Switch Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -343,15 +343,15 @@
 block discarded – undo
343 343
         } else {
344 344
             $lowerVarType = strtolower($varType);
345 345
             switch ($lowerVarType) {
346
-            case 'bool':
347
-                return 'boolean';
348
-            case 'double':
349
-            case 'real':
350
-                return 'float';
351
-            case 'int':
352
-                return 'integer';
353
-            case 'array()':
354
-                return 'array';
346
+                case 'bool':
347
+                    return 'boolean';
348
+                case 'double':
349
+                case 'real':
350
+                    return 'float';
351
+                case 'int':
352
+                    return 'integer';
353
+                case 'array()':
354
+                    return 'array';
355 355
             }//end switch
356 356
 
357 357
             if (strpos($lowerVarType, 'array(') !== false) {
Please login to merge, or discard this patch.
src/Fixer.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -283,14 +283,14 @@
 block discarded – undo
283 283
         foreach ($diffLines as $line) {
284 284
             if (isset($line[0]) === true) {
285 285
                 switch ($line[0]) {
286
-                case '-':
287
-                    $diff[] = "\033[31m$line\033[0m";
288
-                    break;
289
-                case '+':
290
-                    $diff[] = "\033[32m$line\033[0m";
291
-                    break;
292
-                default:
293
-                    $diff[] = $line;
286
+                    case '-':
287
+                        $diff[] = "\033[31m$line\033[0m";
288
+                        break;
289
+                    case '+':
290
+                        $diff[] = "\033[32m$line\033[0m";
291
+                        break;
292
+                    default:
293
+                        $diff[] = $line;
294 294
                 }
295 295
             }
296 296
         }
Please login to merge, or discard this patch.
src/Tokenizers/PHP.php 1 patch
Switch Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -1450,24 +1450,24 @@  discard block
 block discarded – undo
1450 1450
 
1451 1451
         if ($token[0] === T_STRING) {
1452 1452
             switch ($cacheKey) {
1453
-            case 'false':
1454
-                $newToken['type'] = 'T_FALSE';
1455
-                break;
1456
-            case 'true':
1457
-                $newToken['type'] = 'T_TRUE';
1458
-                break;
1459
-            case 'null':
1460
-                $newToken['type'] = 'T_NULL';
1461
-                break;
1462
-            case 'self':
1463
-                $newToken['type'] = 'T_SELF';
1464
-                break;
1465
-            case 'parent':
1466
-                $newToken['type'] = 'T_PARENT';
1467
-                break;
1468
-            default:
1469
-                $newToken['type'] = 'T_STRING';
1470
-                break;
1453
+                case 'false':
1454
+                    $newToken['type'] = 'T_FALSE';
1455
+                    break;
1456
+                case 'true':
1457
+                    $newToken['type'] = 'T_TRUE';
1458
+                    break;
1459
+                case 'null':
1460
+                    $newToken['type'] = 'T_NULL';
1461
+                    break;
1462
+                case 'self':
1463
+                    $newToken['type'] = 'T_SELF';
1464
+                    break;
1465
+                case 'parent':
1466
+                    $newToken['type'] = 'T_PARENT';
1467
+                    break;
1468
+                default:
1469
+                    $newToken['type'] = 'T_STRING';
1470
+                    break;
1471 1471
             }
1472 1472
 
1473 1473
             $newToken['code'] = constant($newToken['type']);
@@ -1509,87 +1509,87 @@  discard block
 block discarded – undo
1509 1509
         $newToken = array();
1510 1510
 
1511 1511
         switch ($token) {
1512
-        case '{':
1513
-            $newToken['type'] = 'T_OPEN_CURLY_BRACKET';
1514
-            break;
1515
-        case '}':
1516
-            $newToken['type'] = 'T_CLOSE_CURLY_BRACKET';
1517
-            break;
1518
-        case '[':
1519
-            $newToken['type'] = 'T_OPEN_SQUARE_BRACKET';
1520
-            break;
1521
-        case ']':
1522
-            $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET';
1523
-            break;
1524
-        case '(':
1525
-            $newToken['type'] = 'T_OPEN_PARENTHESIS';
1526
-            break;
1527
-        case ')':
1528
-            $newToken['type'] = 'T_CLOSE_PARENTHESIS';
1529
-            break;
1530
-        case ':':
1531
-            $newToken['type'] = 'T_COLON';
1532
-            break;
1533
-        case '.':
1534
-            $newToken['type'] = 'T_STRING_CONCAT';
1535
-            break;
1536
-        case '?':
1537
-            $newToken['type'] = 'T_INLINE_THEN';
1538
-            break;
1539
-        case ';':
1540
-            $newToken['type'] = 'T_SEMICOLON';
1541
-            break;
1542
-        case '=':
1543
-            $newToken['type'] = 'T_EQUAL';
1544
-            break;
1545
-        case '*':
1546
-            $newToken['type'] = 'T_MULTIPLY';
1547
-            break;
1548
-        case '/':
1549
-            $newToken['type'] = 'T_DIVIDE';
1550
-            break;
1551
-        case '+':
1552
-            $newToken['type'] = 'T_PLUS';
1553
-            break;
1554
-        case '-':
1555
-            $newToken['type'] = 'T_MINUS';
1556
-            break;
1557
-        case '%':
1558
-            $newToken['type'] = 'T_MODULUS';
1559
-            break;
1560
-        case '^':
1561
-            $newToken['type'] = 'T_BITWISE_XOR';
1562
-            break;
1563
-        case '&':
1564
-            $newToken['type'] = 'T_BITWISE_AND';
1565
-            break;
1566
-        case '|':
1567
-            $newToken['type'] = 'T_BITWISE_OR';
1568
-            break;
1569
-        case '<':
1570
-            $newToken['type'] = 'T_LESS_THAN';
1571
-            break;
1572
-        case '>':
1573
-            $newToken['type'] = 'T_GREATER_THAN';
1574
-            break;
1575
-        case '!':
1576
-            $newToken['type'] = 'T_BOOLEAN_NOT';
1577
-            break;
1578
-        case ',':
1579
-            $newToken['type'] = 'T_COMMA';
1580
-            break;
1581
-        case '@':
1582
-            $newToken['type'] = 'T_ASPERAND';
1583
-            break;
1584
-        case '$':
1585
-            $newToken['type'] = 'T_DOLLAR';
1586
-            break;
1587
-        case '`':
1588
-            $newToken['type'] = 'T_BACKTICK';
1589
-            break;
1590
-        default:
1591
-            $newToken['type'] = 'T_NONE';
1592
-            break;
1512
+            case '{':
1513
+                $newToken['type'] = 'T_OPEN_CURLY_BRACKET';
1514
+                break;
1515
+            case '}':
1516
+                $newToken['type'] = 'T_CLOSE_CURLY_BRACKET';
1517
+                break;
1518
+            case '[':
1519
+                $newToken['type'] = 'T_OPEN_SQUARE_BRACKET';
1520
+                break;
1521
+            case ']':
1522
+                $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET';
1523
+                break;
1524
+            case '(':
1525
+                $newToken['type'] = 'T_OPEN_PARENTHESIS';
1526
+                break;
1527
+            case ')':
1528
+                $newToken['type'] = 'T_CLOSE_PARENTHESIS';
1529
+                break;
1530
+            case ':':
1531
+                $newToken['type'] = 'T_COLON';
1532
+                break;
1533
+            case '.':
1534
+                $newToken['type'] = 'T_STRING_CONCAT';
1535
+                break;
1536
+            case '?':
1537
+                $newToken['type'] = 'T_INLINE_THEN';
1538
+                break;
1539
+            case ';':
1540
+                $newToken['type'] = 'T_SEMICOLON';
1541
+                break;
1542
+            case '=':
1543
+                $newToken['type'] = 'T_EQUAL';
1544
+                break;
1545
+            case '*':
1546
+                $newToken['type'] = 'T_MULTIPLY';
1547
+                break;
1548
+            case '/':
1549
+                $newToken['type'] = 'T_DIVIDE';
1550
+                break;
1551
+            case '+':
1552
+                $newToken['type'] = 'T_PLUS';
1553
+                break;
1554
+            case '-':
1555
+                $newToken['type'] = 'T_MINUS';
1556
+                break;
1557
+            case '%':
1558
+                $newToken['type'] = 'T_MODULUS';
1559
+                break;
1560
+            case '^':
1561
+                $newToken['type'] = 'T_BITWISE_XOR';
1562
+                break;
1563
+            case '&':
1564
+                $newToken['type'] = 'T_BITWISE_AND';
1565
+                break;
1566
+            case '|':
1567
+                $newToken['type'] = 'T_BITWISE_OR';
1568
+                break;
1569
+            case '<':
1570
+                $newToken['type'] = 'T_LESS_THAN';
1571
+                break;
1572
+            case '>':
1573
+                $newToken['type'] = 'T_GREATER_THAN';
1574
+                break;
1575
+            case '!':
1576
+                $newToken['type'] = 'T_BOOLEAN_NOT';
1577
+                break;
1578
+            case ',':
1579
+                $newToken['type'] = 'T_COMMA';
1580
+                break;
1581
+            case '@':
1582
+                $newToken['type'] = 'T_ASPERAND';
1583
+                break;
1584
+            case '$':
1585
+                $newToken['type'] = 'T_DOLLAR';
1586
+                break;
1587
+            case '`':
1588
+                $newToken['type'] = 'T_BACKTICK';
1589
+                break;
1590
+            default:
1591
+                $newToken['type'] = 'T_NONE';
1592
+                break;
1593 1593
         }//end switch
1594 1594
 
1595 1595
         $newToken['code']    = constant($newToken['type']);
Please login to merge, or discard this patch.
src/Tokenizers/Tokenizer.php 1 patch
Switch Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -406,60 +406,60 @@
 block discarded – undo
406 406
             */
407 407
 
408 408
             switch ($this->tokens[$i]['code']) {
409
-            case T_OPEN_SQUARE_BRACKET:
410
-                $squareOpeners[] = $i;
411
-
412
-                if (PHP_CodeSniffer_VERBOSITY > 1) {
413
-                    echo str_repeat("\t", count($squareOpeners));
414
-                    echo str_repeat("\t", count($curlyOpeners));
415
-                    echo "=> Found square bracket opener at $i".PHP_EOL;
416
-                }
417
-                break;
418
-            case T_OPEN_CURLY_BRACKET:
419
-                if (isset($this->tokens[$i]['scope_closer']) === false) {
420
-                    $curlyOpeners[] = $i;
409
+                case T_OPEN_SQUARE_BRACKET:
410
+                    $squareOpeners[] = $i;
421 411
 
422 412
                     if (PHP_CodeSniffer_VERBOSITY > 1) {
423 413
                         echo str_repeat("\t", count($squareOpeners));
424 414
                         echo str_repeat("\t", count($curlyOpeners));
425
-                        echo "=> Found curly bracket opener at $i".PHP_EOL;
415
+                        echo "=> Found square bracket opener at $i".PHP_EOL;
426 416
                     }
427
-                }
428
-                break;
429
-            case T_CLOSE_SQUARE_BRACKET:
430
-                if (empty($squareOpeners) === false) {
431
-                    $opener = array_pop($squareOpeners);
432
-                    $this->tokens[$i]['bracket_opener']      = $opener;
433
-                    $this->tokens[$i]['bracket_closer']      = $i;
434
-                    $this->tokens[$opener]['bracket_opener'] = $opener;
435
-                    $this->tokens[$opener]['bracket_closer'] = $i;
417
+                    break;
418
+                case T_OPEN_CURLY_BRACKET:
419
+                    if (isset($this->tokens[$i]['scope_closer']) === false) {
420
+                        $curlyOpeners[] = $i;
436 421
 
437
-                    if (PHP_CodeSniffer_VERBOSITY > 1) {
438
-                        echo str_repeat("\t", count($squareOpeners));
439
-                        echo str_repeat("\t", count($curlyOpeners));
440
-                        echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL;
422
+                        if (PHP_CodeSniffer_VERBOSITY > 1) {
423
+                            echo str_repeat("\t", count($squareOpeners));
424
+                            echo str_repeat("\t", count($curlyOpeners));
425
+                            echo "=> Found curly bracket opener at $i".PHP_EOL;
426
+                        }
441 427
                     }
442
-                }
443
-                break;
444
-            case T_CLOSE_CURLY_BRACKET:
445
-                if (empty($curlyOpeners) === false
446
-                    && isset($this->tokens[$i]['scope_opener']) === false
447
-                ) {
448
-                    $opener = array_pop($curlyOpeners);
449
-                    $this->tokens[$i]['bracket_opener']      = $opener;
450
-                    $this->tokens[$i]['bracket_closer']      = $i;
451
-                    $this->tokens[$opener]['bracket_opener'] = $opener;
452
-                    $this->tokens[$opener]['bracket_closer'] = $i;
428
+                    break;
429
+                case T_CLOSE_SQUARE_BRACKET:
430
+                    if (empty($squareOpeners) === false) {
431
+                        $opener = array_pop($squareOpeners);
432
+                        $this->tokens[$i]['bracket_opener']      = $opener;
433
+                        $this->tokens[$i]['bracket_closer']      = $i;
434
+                        $this->tokens[$opener]['bracket_opener'] = $opener;
435
+                        $this->tokens[$opener]['bracket_closer'] = $i;
453 436
 
454
-                    if (PHP_CodeSniffer_VERBOSITY > 1) {
455
-                        echo str_repeat("\t", count($squareOpeners));
456
-                        echo str_repeat("\t", count($curlyOpeners));
457
-                        echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL;
437
+                        if (PHP_CodeSniffer_VERBOSITY > 1) {
438
+                            echo str_repeat("\t", count($squareOpeners));
439
+                            echo str_repeat("\t", count($curlyOpeners));
440
+                            echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL;
441
+                        }
458 442
                     }
459
-                }
460
-                break;
461
-            default:
462
-                continue;
443
+                    break;
444
+                case T_CLOSE_CURLY_BRACKET:
445
+                    if (empty($curlyOpeners) === false
446
+                        && isset($this->tokens[$i]['scope_opener']) === false
447
+                    ) {
448
+                        $opener = array_pop($curlyOpeners);
449
+                        $this->tokens[$i]['bracket_opener']      = $opener;
450
+                        $this->tokens[$i]['bracket_closer']      = $i;
451
+                        $this->tokens[$opener]['bracket_opener'] = $opener;
452
+                        $this->tokens[$opener]['bracket_closer'] = $i;
453
+
454
+                        if (PHP_CodeSniffer_VERBOSITY > 1) {
455
+                            echo str_repeat("\t", count($squareOpeners));
456
+                            echo str_repeat("\t", count($curlyOpeners));
457
+                            echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL;
458
+                        }
459
+                    }
460
+                    break;
461
+                default:
462
+                    continue;
463 463
             }//end switch
464 464
         }//end for
465 465
 
Please login to merge, or discard this patch.
src/Config.php 1 patch
Switch Indentation   +275 added lines, -275 removed lines patch added patch discarded remove patch
@@ -202,35 +202,35 @@  discard block
 block discarded – undo
202 202
         }
203 203
 
204 204
         switch ($name) {
205
-        case 'reportWidth' :
206
-            // Support auto terminal width.
207
-            if ($value === 'auto' && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1) {
208
-                $value = (int) $matches[1];
209
-            } else {
210
-                $value = (int) $value;
211
-            }
212
-            break;
213
-        case 'standards' :
214
-            $cleaned = array();
215
-
216
-            // Check if the standard name is valid, or if the case is invalid.
217
-            $installedStandards = Util\Standards::getInstalledStandards();
218
-            foreach ($value as $standard) {
219
-                foreach ($installedStandards as $validStandard) {
220
-                    if (strtolower($standard) === strtolower($validStandard)) {
221
-                        $standard = $validStandard;
222
-                        break;
223
-                    }
205
+            case 'reportWidth' :
206
+                // Support auto terminal width.
207
+                if ($value === 'auto' && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1) {
208
+                    $value = (int) $matches[1];
209
+                } else {
210
+                    $value = (int) $value;
224 211
                 }
212
+                break;
213
+            case 'standards' :
214
+                $cleaned = array();
215
+
216
+                // Check if the standard name is valid, or if the case is invalid.
217
+                $installedStandards = Util\Standards::getInstalledStandards();
218
+                foreach ($value as $standard) {
219
+                    foreach ($installedStandards as $validStandard) {
220
+                        if (strtolower($standard) === strtolower($validStandard)) {
221
+                            $standard = $validStandard;
222
+                            break;
223
+                        }
224
+                    }
225 225
 
226
-                $cleaned[] = $standard;
227
-            }
226
+                    $cleaned[] = $standard;
227
+                }
228 228
 
229
-            $value = $cleaned;
230
-            break;
231
-        default :
232
-            // No validation required.
233
-            break;
229
+                $value = $cleaned;
230
+                break;
231
+            default :
232
+                // No validation required.
233
+                break;
234 234
         }//end switch
235 235
 
236 236
         $this->settings[$name] = $value;
@@ -502,68 +502,68 @@  discard block
 block discarded – undo
502 502
     public function processShortArgument($arg, $pos)
503 503
     {
504 504
         switch ($arg) {
505
-        case 'h':
506
-        case '?':
507
-            $this->printUsage();
508
-            exit(0);
509
-        case 'i' :
510
-            Util\Standards::printInstalledStandards();
511
-            exit(0);
512
-        case 'v' :
513
-            $this->verbosity++;
514
-            $this->overriddenDefaults['verbosity'] = true;
515
-            break;
516
-        case 'l' :
517
-            $this->local = true;
518
-            $this->overriddenDefaults['local'] = true;
519
-            break;
520
-        case 's' :
521
-            $this->showSources = true;
522
-            $this->overriddenDefaults['showSources'] = true;
523
-            break;
524
-        case 'a' :
525
-            $this->interactive = true;
526
-            $this->overriddenDefaults['interactive'] = true;
527
-            break;
528
-        case 'e':
529
-            $this->explain = true;
530
-            $this->overriddenDefaults['explain'] = true;
531
-            break;
532
-        case 'p' :
533
-            $this->showProgress = true;
534
-            $this->overriddenDefaults['showProgress'] = true;
535
-            break;
536
-        case 'm' :
537
-            $this->recordErrors = false;
538
-            $this->overriddenDefaults['recordErrors'] = true;
539
-            break;
540
-        case 'd' :
541
-            $ini = explode('=', $this->cliArgs[($pos + 1)]);
542
-            $this->cliArgs[($pos + 1)] = '';
543
-            if (isset($ini[1]) === true) {
544
-                ini_set($ini[0], $ini[1]);
545
-            } else {
546
-                ini_set($ini[0], true);
547
-            }
548
-            break;
549
-        case 'n' :
550
-            if (isset($this->overriddenDefaults['warningSeverity']) === false) {
551
-                $this->warningSeverity = 0;
552
-                $this->overriddenDefaults['warningSeverity'] = true;
553
-            }
554
-            break;
555
-        case 'w' :
556
-            if (isset($this->overriddenDefaults['warningSeverity']) === false) {
557
-                $this->warningSeverity = $this->errorSeverity;
558
-                $this->overriddenDefaults['warningSeverity'] = true;
559
-            }
560
-            break;
561
-        default:
562
-            if ($this->dieOnUnknownArg === false) {
563
-                $this->values[$arg] = $arg;
564
-            } else {
565
-                $this->processUnknownArgument('-'.$arg, $pos);
566
-            }
505
+            case 'h':
506
+            case '?':
507
+                $this->printUsage();
508
+                exit(0);
509
+            case 'i' :
510
+                Util\Standards::printInstalledStandards();
511
+                exit(0);
512
+            case 'v' :
513
+                $this->verbosity++;
514
+                $this->overriddenDefaults['verbosity'] = true;
515
+                break;
516
+            case 'l' :
517
+                $this->local = true;
518
+                $this->overriddenDefaults['local'] = true;
519
+                break;
520
+            case 's' :
521
+                $this->showSources = true;
522
+                $this->overriddenDefaults['showSources'] = true;
523
+                break;
524
+            case 'a' :
525
+                $this->interactive = true;
526
+                $this->overriddenDefaults['interactive'] = true;
527
+                break;
528
+            case 'e':
529
+                $this->explain = true;
530
+                $this->overriddenDefaults['explain'] = true;
531
+                break;
532
+            case 'p' :
533
+                $this->showProgress = true;
534
+                $this->overriddenDefaults['showProgress'] = true;
535
+                break;
536
+            case 'm' :
537
+                $this->recordErrors = false;
538
+                $this->overriddenDefaults['recordErrors'] = true;
539
+                break;
540
+            case 'd' :
541
+                $ini = explode('=', $this->cliArgs[($pos + 1)]);
542
+                $this->cliArgs[($pos + 1)] = '';
543
+                if (isset($ini[1]) === true) {
544
+                    ini_set($ini[0], $ini[1]);
545
+                } else {
546
+                    ini_set($ini[0], true);
547
+                }
548
+                break;
549
+            case 'n' :
550
+                if (isset($this->overriddenDefaults['warningSeverity']) === false) {
551
+                    $this->warningSeverity = 0;
552
+                    $this->overriddenDefaults['warningSeverity'] = true;
553
+                }
554
+                break;
555
+            case 'w' :
556
+                if (isset($this->overriddenDefaults['warningSeverity']) === false) {
557
+                    $this->warningSeverity = $this->errorSeverity;
558
+                    $this->overriddenDefaults['warningSeverity'] = true;
559
+                }
560
+                break;
561
+            default:
562
+                if ($this->dieOnUnknownArg === false) {
563
+                    $this->values[$arg] = $arg;
564
+                } else {
565
+                    $this->processUnknownArgument('-'.$arg, $pos);
566
+                }
567 567
         }//end switch
568 568
 
569 569
     }//end processShortArgument()
@@ -580,223 +580,223 @@  discard block
 block discarded – undo
580 580
     public function processLongArgument($arg, $pos)
581 581
     {
582 582
         switch ($arg) {
583
-        case 'help':
584
-            $this->printUsage();
585
-            exit(0);
586
-        case 'version':
587
-            echo 'Symplify\PHP7_CodeSniffer version '.self::VERSION.' ('.self::STABILITY.') ';
588
-            echo 'by Squiz (http://www.squiz.net)'.PHP_EOL;
589
-            exit(0);
590
-        case 'colors':
591
-            $this->colors = true;
592
-            $this->overriddenDefaults['colors'] = true;
593
-            break;
594
-        case 'no-colors':
595
-            $this->colors = false;
596
-            $this->overriddenDefaults['colors'] = true;
597
-            break;
598
-        case 'cache':
599
-            if (defined('Symplify\PHP7_CodeSniffer_IN_TESTS') === false) {
600
-                $this->cache = true;
583
+            case 'help':
584
+                $this->printUsage();
585
+                exit(0);
586
+            case 'version':
587
+                echo 'Symplify\PHP7_CodeSniffer version '.self::VERSION.' ('.self::STABILITY.') ';
588
+                echo 'by Squiz (http://www.squiz.net)'.PHP_EOL;
589
+                exit(0);
590
+            case 'colors':
591
+                $this->colors = true;
592
+                $this->overriddenDefaults['colors'] = true;
593
+                break;
594
+            case 'no-colors':
595
+                $this->colors = false;
596
+                $this->overriddenDefaults['colors'] = true;
597
+                break;
598
+            case 'cache':
599
+                if (defined('Symplify\PHP7_CodeSniffer_IN_TESTS') === false) {
600
+                    $this->cache = true;
601
+                    $this->overriddenDefaults['cache'] = true;
602
+                }
603
+                break;
604
+            case 'no-cache':
605
+                $this->cache = false;
601 606
                 $this->overriddenDefaults['cache'] = true;
602
-            }
603
-            break;
604
-        case 'no-cache':
605
-            $this->cache = false;
606
-            $this->overriddenDefaults['cache'] = true;
607
-            break;
608
-        default:
609
-            if (substr($arg, 0, 7) === 'sniffs=') {
610
-                $sniffs = explode(',', substr($arg, 7));
611
-                foreach ($sniffs as $sniff) {
612
-                    if (substr_count($sniff, '.') !== 2) {
613
-                        echo 'ERROR: The specified sniff code "'.$sniff.'" is invalid'.PHP_EOL.PHP_EOL;
614
-                        $this->printUsage();
615
-                        exit(2);
607
+                break;
608
+            default:
609
+                if (substr($arg, 0, 7) === 'sniffs=') {
610
+                    $sniffs = explode(',', substr($arg, 7));
611
+                    foreach ($sniffs as $sniff) {
612
+                        if (substr_count($sniff, '.') !== 2) {
613
+                            echo 'ERROR: The specified sniff code "'.$sniff.'" is invalid'.PHP_EOL.PHP_EOL;
614
+                            $this->printUsage();
615
+                            exit(2);
616
+                        }
616 617
                     }
617
-                }
618 618
 
619
-                $this->sniffs = $sniffs;
620
-                $this->overriddenDefaults['sniffs'] = true;
621
-            } else if (defined('Symplify\PHP7_CodeSniffer_IN_TESTS') === false
622
-                && substr($arg, 0, 6) === 'cache='
623
-            ) {
624
-                // Turn caching on.
625
-                $this->cache = true;
626
-                $this->overriddenDefaults['cache'] = true;
619
+                    $this->sniffs = $sniffs;
620
+                    $this->overriddenDefaults['sniffs'] = true;
621
+                } else if (defined('Symplify\PHP7_CodeSniffer_IN_TESTS') === false
622
+                    && substr($arg, 0, 6) === 'cache='
623
+                ) {
624
+                    // Turn caching on.
625
+                    $this->cache = true;
626
+                    $this->overriddenDefaults['cache'] = true;
627
+
628
+                    $this->cacheFile = Util\Common::realpath(substr($arg, 6));
629
+
630
+                    // It may not exist and return false instead.
631
+                    if ($this->cacheFile === false) {
632
+                        $this->cacheFile = substr($arg, 6);
633
+
634
+                        $dir = dirname($this->cacheFile);
635
+                        if (is_dir($dir) === false) {
636
+                            echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
637
+                            $this->printUsage();
638
+                            exit(2);
639
+                        }
627 640
 
628
-                $this->cacheFile = Util\Common::realpath(substr($arg, 6));
641
+                        if ($dir === '.') {
642
+                            // Passed report file is a file in the current directory.
643
+                            $this->cacheFile = getcwd().'/'.basename($this->cacheFile);
644
+                        } else {
645
+                            $dir = Util\Common::realpath(getcwd().'/'.$dir);
646
+                            if ($dir !== false) {
647
+                                // Report file path is relative.
648
+                                $this->cacheFile = $dir.'/'.basename($this->cacheFile);
649
+                            }
650
+                        }
651
+                    }//end if
629 652
 
630
-                // It may not exist and return false instead.
631
-                if ($this->cacheFile === false) {
632
-                    $this->cacheFile = substr($arg, 6);
653
+                    $this->overriddenDefaults['cacheFile'] = true;
633 654
 
634
-                    $dir = dirname($this->cacheFile);
635
-                    if (is_dir($dir) === false) {
636
-                        echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
655
+                    if (is_dir($this->cacheFile) === true) {
656
+                        echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" is a directory'.PHP_EOL.PHP_EOL;
637 657
                         $this->printUsage();
638 658
                         exit(2);
639 659
                     }
640
-
641
-                    if ($dir === '.') {
642
-                        // Passed report file is a file in the current directory.
643
-                        $this->cacheFile = getcwd().'/'.basename($this->cacheFile);
644
-                    } else {
645
-                        $dir = Util\Common::realpath(getcwd().'/'.$dir);
646
-                        if ($dir !== false) {
647
-                            // Report file path is relative.
648
-                            $this->cacheFile = $dir.'/'.basename($this->cacheFile);
660
+                } else if (substr($arg, 0, 10) === 'bootstrap=') {
661
+                    $files     = explode(',', substr($arg, 10));
662
+                    $bootstrap = array();
663
+                    foreach ($files as $file) {
664
+                        $path = Util\Common::realpath($file);
665
+                        if ($path === false) {
666
+                            echo 'ERROR: The specified bootstrap file "'.$file.'" does not exist'.PHP_EOL.PHP_EOL;
667
+                            $this->printUsage();
668
+                            exit(2);
649 669
                         }
650
-                    }
651
-                }//end if
652 670
 
653
-                $this->overriddenDefaults['cacheFile'] = true;
654
-
655
-                if (is_dir($this->cacheFile) === true) {
656
-                    echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" is a directory'.PHP_EOL.PHP_EOL;
657
-                    $this->printUsage();
658
-                    exit(2);
659
-                }
660
-            } else if (substr($arg, 0, 10) === 'bootstrap=') {
661
-                $files     = explode(',', substr($arg, 10));
662
-                $bootstrap = array();
663
-                foreach ($files as $file) {
664
-                    $path = Util\Common::realpath($file);
665
-                    if ($path === false) {
666
-                        echo 'ERROR: The specified bootstrap file "'.$file.'" does not exist'.PHP_EOL.PHP_EOL;
667
-                        $this->printUsage();
668
-                        exit(2);
671
+                        $bootstrap[] = $path;
669 672
                     }
670 673
 
671
-                    $bootstrap[] = $path;
672
-                }
674
+                    $this->bootstrap = array_merge($this->bootstrap, $bootstrap);
675
+                    $this->overriddenDefaults['bootstrap'] = true;
676
+                } else if (substr($arg, 0, 11) === 'stdin-path=') {
677
+                    $this->stdinPath = Util\Common::realpath(substr($arg, 11));
673 678
 
674
-                $this->bootstrap = array_merge($this->bootstrap, $bootstrap);
675
-                $this->overriddenDefaults['bootstrap'] = true;
676
-            } else if (substr($arg, 0, 11) === 'stdin-path=') {
677
-                $this->stdinPath = Util\Common::realpath(substr($arg, 11));
679
+                    // It may not exist and return false instead, so use whatever they gave us.
680
+                    if ($this->stdinPath === false) {
681
+                        $this->stdinPath = trim(substr($arg, 11));
682
+                    }
678 683
 
679
-                // It may not exist and return false instead, so use whatever they gave us.
680
-                if ($this->stdinPath === false) {
681
-                    $this->stdinPath = trim(substr($arg, 11));
682
-                }
684
+                    $this->overriddenDefaults['stdinPath'] = true;
685
+                } else if (substr($arg, 0, 9) === 'basepath=') {
686
+                    if (isset($this->overriddenDefaults['basepath']) === true) {
687
+                        break;
688
+                    }
683 689
 
684
-                $this->overriddenDefaults['stdinPath'] = true;
685
-            } else if (substr($arg, 0, 9) === 'basepath=') {
686
-                if (isset($this->overriddenDefaults['basepath']) === true) {
687
-                    break;
688
-                }
690
+                    $this->basepath = Util\Common::realpath(substr($arg, 9));
689 691
 
690
-                $this->basepath = Util\Common::realpath(substr($arg, 9));
692
+                    // It may not exist and return false instead.
693
+                    if ($this->basepath === false) {
694
+                        $this->basepath = substr($arg, 9);
695
+                    }
691 696
 
692
-                // It may not exist and return false instead.
693
-                if ($this->basepath === false) {
694
-                    $this->basepath = substr($arg, 9);
695
-                }
697
+                    $this->overriddenDefaults['basepath'] = true;
696 698
 
697
-                $this->overriddenDefaults['basepath'] = true;
699
+                    if (is_dir($this->basepath) === false) {
700
+                        echo 'ERROR: The specified basepath "'.$this->basepath.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
701
+                        $this->printUsage();
702
+                        exit(2);
703
+                    }
704
+                } else if (substr($arg, 0, 7) === 'filter=') {
705
+                    if (isset($this->overriddenDefaults['filter']) === true) {
706
+                        break;
707
+                    }
698 708
 
699
-                if (is_dir($this->basepath) === false) {
700
-                    echo 'ERROR: The specified basepath "'.$this->basepath.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
701
-                    $this->printUsage();
702
-                    exit(2);
703
-                }
704
-            } else if (substr($arg, 0, 7) === 'filter=') {
705
-                if (isset($this->overriddenDefaults['filter']) === true) {
706
-                    break;
707
-                }
709
+                    $this->filter = substr($arg, 7);
710
+                    $this->overriddenDefaults['filter'] = true;
711
+                } else if (substr($arg, 0, 9) === 'standard=') {
712
+                    $standards = trim(substr($arg, 9));
713
+                    if ($standards !== '') {
714
+                        $this->standards = explode(',', $standards);
715
+                    }
708 716
 
709
-                $this->filter = substr($arg, 7);
710
-                $this->overriddenDefaults['filter'] = true;
711
-            } else if (substr($arg, 0, 9) === 'standard=') {
712
-                $standards = trim(substr($arg, 9));
713
-                if ($standards !== '') {
714
-                    $this->standards = explode(',', $standards);
715
-                }
717
+                    $this->overriddenDefaults['standards'] = true;
718
+                } else if (substr($arg, 0, 11) === 'extensions=') {
719
+                    $extensions    = explode(',', substr($arg, 11));
720
+                    $newExtensions = array();
721
+                    foreach ($extensions as $ext) {
722
+                        $slash = strpos($ext, '/');
723
+                        if ($slash !== false) {
724
+                            // They specified the tokenizer too.
725
+                            list($ext, $tokenizer) = explode('/', $ext);
726
+                            $newExtensions[$ext]   = strtoupper($tokenizer);
727
+                            continue;
728
+                        }
716 729
 
717
-                $this->overriddenDefaults['standards'] = true;
718
-            } else if (substr($arg, 0, 11) === 'extensions=') {
719
-                $extensions    = explode(',', substr($arg, 11));
720
-                $newExtensions = array();
721
-                foreach ($extensions as $ext) {
722
-                    $slash = strpos($ext, '/');
723
-                    if ($slash !== false) {
724
-                        // They specified the tokenizer too.
725
-                        list($ext, $tokenizer) = explode('/', $ext);
726
-                        $newExtensions[$ext]   = strtoupper($tokenizer);
727
-                        continue;
730
+                        if (isset($this->extensions[$ext]) === true) {
731
+                            $newExtensions[$ext] = $this->extensions[$ext];
732
+                        } else {
733
+                            $newExtensions[$ext] = 'PHP';
734
+                        }
728 735
                     }
729 736
 
730
-                    if (isset($this->extensions[$ext]) === true) {
731
-                        $newExtensions[$ext] = $this->extensions[$ext];
732
-                    } else {
733
-                        $newExtensions[$ext] = 'PHP';
734
-                    }
735
-                }
737
+                    $this->extensions = $newExtensions;
738
+                    $this->overriddenDefaults['extensions'] = true;
739
+                } else if (substr($arg, 0, 7) === 'suffix=') {
740
+                    $this->suffix = explode(',', substr($arg, 7));
741
+                    $this->overriddenDefaults['suffix'] = true;
742
+                } else if (substr($arg, 0, 9) === 'parallel=') {
743
+                    $this->parallel = max((int) substr($arg, 9), 1);
744
+                    $this->overriddenDefaults['parallel'] = true;
745
+                } else if (substr($arg, 0, 9) === 'severity=') {
746
+                    $this->errorSeverity   = (int) substr($arg, 9);
747
+                    $this->warningSeverity = $this->errorSeverity;
748
+                    $this->overriddenDefaults['errorSeverity']   = true;
749
+                    $this->overriddenDefaults['warningSeverity'] = true;
750
+                } else if (substr($arg, 0, 15) === 'error-severity=') {
751
+                    $this->errorSeverity = (int) substr($arg, 15);
752
+                    $this->overriddenDefaults['errorSeverity'] = true;
753
+                } else if (substr($arg, 0, 17) === 'warning-severity=') {
754
+                    $this->warningSeverity = (int) substr($arg, 17);
755
+                    $this->overriddenDefaults['warningSeverity'] = true;
756
+                } else if (substr($arg, 0, 7) === 'ignore=') {
757
+                    // Split the ignore string on commas, unless the comma is escaped
758
+                    // using 1 or 3 slashes (\, or \\\,).
759
+                    $patterns = preg_split(
760
+                        '/(?<=(?<!\\\\)\\\\\\\\),|(?<!\\\\),/',
761
+                        substr($arg, 7)
762
+                    );
763
+
764
+                    $ignored = array();
765
+                    foreach ($patterns as $pattern) {
766
+                        $pattern = trim($pattern);
767
+                        if ($pattern === '') {
768
+                            continue;
769
+                        }
736 770
 
737
-                $this->extensions = $newExtensions;
738
-                $this->overriddenDefaults['extensions'] = true;
739
-            } else if (substr($arg, 0, 7) === 'suffix=') {
740
-                $this->suffix = explode(',', substr($arg, 7));
741
-                $this->overriddenDefaults['suffix'] = true;
742
-            } else if (substr($arg, 0, 9) === 'parallel=') {
743
-                $this->parallel = max((int) substr($arg, 9), 1);
744
-                $this->overriddenDefaults['parallel'] = true;
745
-            } else if (substr($arg, 0, 9) === 'severity=') {
746
-                $this->errorSeverity   = (int) substr($arg, 9);
747
-                $this->warningSeverity = $this->errorSeverity;
748
-                $this->overriddenDefaults['errorSeverity']   = true;
749
-                $this->overriddenDefaults['warningSeverity'] = true;
750
-            } else if (substr($arg, 0, 15) === 'error-severity=') {
751
-                $this->errorSeverity = (int) substr($arg, 15);
752
-                $this->overriddenDefaults['errorSeverity'] = true;
753
-            } else if (substr($arg, 0, 17) === 'warning-severity=') {
754
-                $this->warningSeverity = (int) substr($arg, 17);
755
-                $this->overriddenDefaults['warningSeverity'] = true;
756
-            } else if (substr($arg, 0, 7) === 'ignore=') {
757
-                // Split the ignore string on commas, unless the comma is escaped
758
-                // using 1 or 3 slashes (\, or \\\,).
759
-                $patterns = preg_split(
760
-                    '/(?<=(?<!\\\\)\\\\\\\\),|(?<!\\\\),/',
761
-                    substr($arg, 7)
762
-                );
763
-
764
-                $ignored = array();
765
-                foreach ($patterns as $pattern) {
766
-                    $pattern = trim($pattern);
767
-                    if ($pattern === '') {
768
-                        continue;
771
+                        $ignored[$pattern] = 'absolute';
769 772
                     }
770 773
 
771
-                    $ignored[$pattern] = 'absolute';
772
-                }
773
-
774
-                $this->ignored = $ignored;
775
-                $this->overriddenDefaults['ignored'] = true;
776
-            } else if (substr($arg, 0, 10) === 'generator='
777
-                && PHP_CodeSniffer_CBF === false
778
-            ) {
779
-                $this->generator = substr($arg, 10);
780
-                $this->overriddenDefaults['generator'] = true;
781
-            } else if (substr($arg, 0, 10) === 'tab-width=') {
782
-                $this->tabWidth = (int) substr($arg, 10);
783
-                $this->overriddenDefaults['tabWidth'] = true;
784
-            } else {
785
-                if ($this->dieOnUnknownArg === false) {
786
-                    $eqPos = strpos($arg, '=');
787
-                    if ($eqPos === false) {
788
-                        $this->values[$arg] = $arg;
774
+                    $this->ignored = $ignored;
775
+                    $this->overriddenDefaults['ignored'] = true;
776
+                } else if (substr($arg, 0, 10) === 'generator='
777
+                    && PHP_CodeSniffer_CBF === false
778
+                ) {
779
+                    $this->generator = substr($arg, 10);
780
+                    $this->overriddenDefaults['generator'] = true;
781
+                } else if (substr($arg, 0, 10) === 'tab-width=') {
782
+                    $this->tabWidth = (int) substr($arg, 10);
783
+                    $this->overriddenDefaults['tabWidth'] = true;
784
+                } else {
785
+                    if ($this->dieOnUnknownArg === false) {
786
+                        $eqPos = strpos($arg, '=');
787
+                        if ($eqPos === false) {
788
+                            $this->values[$arg] = $arg;
789
+                        } else {
790
+                            $value = substr($arg, ($eqPos + 1));
791
+                            $arg   = substr($arg, 0, $eqPos);
792
+                            $this->values[$arg] = $value;
793
+                        }
789 794
                     } else {
790
-                        $value = substr($arg, ($eqPos + 1));
791
-                        $arg   = substr($arg, 0, $eqPos);
792
-                        $this->values[$arg] = $value;
795
+                        $this->processUnknownArgument('--'.$arg, $pos);
793 796
                     }
794
-                } else {
795
-                    $this->processUnknownArgument('--'.$arg, $pos);
796
-                }
797
-            }//end if
797
+                }//end if
798 798
 
799
-            break;
799
+                break;
800 800
         }//end switch
801 801
 
802 802
     }//end processLongArgument()
Please login to merge, or discard this patch.