Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
54 | 5 | public function process(File $file, Report $report) { |
|
55 | 5 | $fileContent = $file->getContent()->get(); |
|
56 | |||
57 | 5 | foreach (self::$regexp as $regexp) { |
|
58 | 5 | if (preg_match($regexp, $fileContent) === 1) { |
|
59 | 5 | return; |
|
60 | } |
||
61 | } |
||
62 | |||
63 | 3 | $message = 'File must begin with `<?php` or `<?` or `#!/usr/bin/env php`'; |
|
64 | 3 | $report->addMessage($file, $this, $message, 1); |
|
65 | |||
66 | 3 | } |
|
67 | |||
68 | } |