Conditions | 5 |
Paths | 15 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | 3 | public function getFiles(array $path): Traversable |
|
38 | { |
||
39 | try { |
||
40 | 3 | $list = $this->files->readDir($path); |
|
41 | 2 | foreach ($list as $item) { |
|
42 | /** @var Node $item */ |
||
43 | 2 | if (empty($item->getPath())) { |
|
44 | // root - skip |
||
45 | 2 | continue; |
|
46 | } |
||
47 | 2 | $this->arrPath->setArray($item->getPath()); |
|
48 | 2 | if ($this->filterExt(Stuff::fileExt($this->arrPath->getFileName()))) { |
|
49 | 2 | yield $this->arrPath->getFileName(); |
|
50 | } |
||
51 | } |
||
52 | 1 | } catch (FilesException $ex) { |
|
53 | 1 | throw new MenuException($ex->getMessage(), $ex->getCode(), $ex); |
|
54 | } |
||
57 |