Code Duplication    Length = 5-6 lines in 5 locations

src/Tokenizers/JS.php 1 location

@@ 1078-1083 (lines=6) @@
1075
                $this->tokens[$closer]['code'] = T_CLOSE_OBJECT;
1076
                $this->tokens[$closer]['type'] = 'T_CLOSE_OBJECT';
1077
1078
                if (PHP_CodeSniffer_VERBOSITY > 1) {
1079
                    echo str_repeat("\t", count($classStack));
1080
                    echo "\t* token $i converted from T_OPEN_CURLY_BRACKET to T_OBJECT *".PHP_EOL;
1081
                    echo str_repeat("\t", count($classStack));
1082
                    echo "\t* token $closer converted from T_CLOSE_CURLY_BRACKET to T_CLOSE_OBJECT *".PHP_EOL;
1083
                }
1084
1085
                for ($x = ($i + 1); $x < $closer; $x++) {
1086
                    $this->tokens[$x]['conditions'][$i] = T_OBJECT;

src/Tokenizers/Tokenizer.php 4 locations

@@ 412-416 (lines=5) @@
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) {
@@ 422-426 (lines=5) @@
419
                if (isset($this->tokens[$i]['scope_closer']) === false) {
420
                    $curlyOpeners[] = $i;
421
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
                    }
427
                }
428
                break;
429
            case T_CLOSE_SQUARE_BRACKET:
@@ 437-441 (lines=5) @@
434
                    $this->tokens[$opener]['bracket_opener'] = $opener;
435
                    $this->tokens[$opener]['bracket_closer'] = $i;
436
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
                    }
442
                }
443
                break;
444
            case T_CLOSE_CURLY_BRACKET:
@@ 454-458 (lines=5) @@
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: