Total Complexity | 1 |
Total Lines | 15 |
Duplicated Lines | 0 % |
1 | import re |
||
8 | class PHPLintBear(LocalBear, Lint): |
||
9 | executable = 'php' |
||
10 | arguments = '-l -n -d display_errors=On -d log_errors=Off' |
||
11 | output_regex = re.compile( |
||
12 | r'(?P<severity>\S+) error: ' |
||
13 | r'(?P<message>.*) in (?P<file_name>.*) on line (?P<line>\d+)') |
||
14 | severity_map = { |
||
15 | "Parse": RESULT_SEVERITY.MAJOR, |
||
16 | "Fatal": RESULT_SEVERITY.MAJOR} |
||
17 | |||
18 | def run(self, filename, file): |
||
19 | ''' |
||
20 | Checks the code with `php -l`. This runs it on each file separately. |
||
21 | ''' |
||
22 | return self.lint(filename) |
||
23 |