| Conditions | 3 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 74 | 2 | protected function getSourcesFromFinder($source) |
|
| 75 | { |
||
| 76 | 2 | $array = explode(DIRECTORY_SEPARATOR, $source); |
|
| 77 | 2 | $filename = array_pop($array); |
|
| 78 | 2 | $directory = $source; |
|
| 79 | 2 | $pattern = '*'; |
|
| 80 | |||
| 81 | // if a dot is present, the last part is the filename pattern |
||
| 82 | 2 | if (strstr($filename, '.') !== false) { |
|
| 83 | 2 | $pattern = $filename; |
|
| 84 | 2 | $directory = implode('/', $array); |
|
| 85 | 2 | } |
|
| 86 | 2 | $finder = new Finder(); |
|
| 87 | $finder |
||
| 88 | 2 | ->name($pattern) |
|
| 89 | 2 | ->in($directory); |
|
| 90 | |||
| 91 | 2 | $sources = []; |
|
| 92 | |||
| 93 | 2 | foreach ($finder as $source) { |
|
| 94 | 2 | $sources[] = $source; |
|
| 95 | 2 | } |
|
| 96 | |||
| 97 | 2 | return $sources; |
|
| 98 | } |
||
| 99 | } |
||
| 100 |