Code Duplication    Length = 6-9 lines in 2 locations

lib/PhpParser/Lexer.php 2 locations

@@ 86-91 (lines=6) @@
83
            return;
84
        }
85
86
        if (preg_match(
87
            '~^Unterminated comment starting line ([0-9]+)$~',
88
            $error['message'], $matches
89
        )) {
90
            throw new Error('Unterminated comment', (int) $matches[1]);
91
        }
92
93
        if (preg_match(
94
            '~^Unexpected character in input:  \'(.)\' \(ASCII=([0-9]+)\)~s',
@@ 93-101 (lines=9) @@
90
            throw new Error('Unterminated comment', (int) $matches[1]);
91
        }
92
93
        if (preg_match(
94
            '~^Unexpected character in input:  \'(.)\' \(ASCII=([0-9]+)\)~s',
95
            $error['message'], $matches
96
        )) {
97
            throw new Error(sprintf(
98
                'Unexpected character "%s" (ASCII %d)',
99
                $matches[1], $matches[2]
100
            ));
101
        }
102
103
        // PHP cuts error message after null byte, so need special case
104
        if (preg_match('~^Unexpected character in input:  \'$~', $error['message'])) {