Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
18 | public function find(array $source) : array |
||
19 | { |
||
20 | $files = []; |
||
21 | |||
22 | foreach ($source as $singleSource) { |
||
23 | if (is_file($singleSource)) { |
||
24 | $files[$singleSource] = new SplFileInfo($singleSource); |
||
25 | } else { |
||
26 | $finder = (new Finder())->files() |
||
27 | ->name('*.php') |
||
28 | ->in($singleSource); |
||
29 | |||
30 | $files = array_merge( |
||
31 | $files, |
||
32 | iterator_to_array($finder->getIterator()) |
||
33 | ); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return $files; |
||
38 | } |
||
39 | } |
||
40 |