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 |
||
35 | 3 | public function getFiles(array $path): Traversable |
|
36 | { |
||
37 | try { |
||
38 | 3 | $list = $this->files->readDir($path); |
|
39 | 2 | foreach ($list as $item) { |
|
40 | /** @var Node $item */ |
||
41 | 2 | if (empty($item->getPath())) { |
|
42 | // root - skip |
||
43 | 2 | continue; |
|
44 | } |
||
45 | 2 | $this->arrPath->setArray($item->getPath()); |
|
46 | 2 | if ($this->filterExt(Stuff::fileExt($this->arrPath->getFileName()))) { |
|
47 | 2 | yield $this->arrPath->getFileName(); |
|
48 | } |
||
49 | } |
||
50 | 1 | } catch (FilesException $ex) { |
|
51 | 1 | throw new MenuException($ex->getMessage(), $ex->getCode(), $ex); |
|
52 | } |
||
55 |