| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 15 | public function create(SplFileInfo $file) : AbstractFile |
|
| 32 | { |
||
| 33 | 15 | $relativeSource = substr($file->getPathname(), strlen($this->configuration->getSourceDirectory())); |
|
| 34 | 15 | $relativeSource = ltrim($relativeSource, DIRECTORY_SEPARATOR); |
|
| 35 | |||
| 36 | 15 | if (Strings::endsWith($file->getPath(), '_posts')) { |
|
| 37 | 5 | return new PostFile($file, $relativeSource); |
|
| 38 | } |
||
| 39 | |||
| 40 | 11 | return new File($file, $relativeSource); |
|
| 41 | } |
||
| 42 | } |
||
| 43 |