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