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