Conditions | 5 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
45 | 38 | public function fetch() |
|
46 | { |
||
47 | 38 | $backupFiles = array(); |
|
48 | |||
49 | 38 | foreach ($this->globs as $glob => $rootPath) { |
|
50 | 38 | $files = glob($glob, GLOB_ERR); |
|
51 | |||
52 | 38 | if ($files === false) { |
|
53 | |||
54 | 4 | throw new SourceException(sprintf('GlobSource expression "%s" is not correct and it fails getting list of files.', $glob)); |
|
55 | |||
56 | 36 | } elseif (count($files)) { |
|
57 | |||
58 | 36 | foreach ($files as $file) { |
|
59 | 36 | $backupFiles[] = File::fromLocal($file, $rootPath); |
|
60 | 18 | } |
|
61 | 18 | } |
|
62 | 18 | } |
|
63 | |||
64 | 36 | return $backupFiles; |
|
65 | } |
||
66 | } |
||
67 |