Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function getIterator(): \Traversable |
||
21 | { |
||
22 | if (is_file($this->filename)) { |
||
23 | yield basename($this->filename) => $this->readFile($this->filename); |
||
24 | return; |
||
25 | } |
||
26 | |||
27 | foreach (new \DirectoryIterator($this->filename) as $fileInfo) { |
||
28 | if (in_array(strtolower($fileInfo->getExtension()), ['md', 'mdown', 'markdown'])) { |
||
29 | yield $fileInfo->getFilename() => $this->readFile($fileInfo->getRealPath()); |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 | |||
43 |