| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 2 | public function build(SplFileInfo $fileInfo) |
|
| 22 | { |
||
| 23 | 2 | $content = $fileInfo->getContents(); |
|
| 24 | 2 | preg_match(self::DELIMITER_PATTERN, $content, $matches, PREG_OFFSET_CAPTURE); |
|
| 25 | |||
| 26 | 2 | if (!empty($matches)) { |
|
| 27 | 1 | $content = substr($content, 0, $matches[0][1] - 1); |
|
| 28 | 1 | } |
|
| 29 | |||
| 30 | 2 | return new Candidate($fileInfo->getFilename(), $content); |
|
| 31 | } |
||
| 32 | } |
||
| 33 |