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