Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
40 | 1 | public function getBackupFiles(): array |
|
41 | { |
||
42 | 1 | $list = $this->sftp->_list($this->path); |
|
43 | 1 | foreach ($list as $fileInfo) { |
|
44 | 1 | if ($fileInfo['type'] === 2) { |
|
45 | 1 | continue; |
|
46 | } |
||
47 | // skip currently created backup |
||
48 | 1 | if ($fileInfo['filename'] == $this->target->getFilename()) { |
|
49 | 1 | continue; |
|
50 | } |
||
51 | 1 | if ($this->isFilenameMatch($fileInfo['filename'])) { |
|
52 | 1 | $this->files[] = new \phpbu\App\Backup\File\Sftp($this->sftp, $fileInfo, $this->path); |
|
53 | } |
||
54 | } |
||
55 | |||
56 | 1 | return $this->files; |
|
57 | } |
||
58 | } |