Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5.025 |
Changes | 0 |
1 | <?php |
||
41 | 1 | public function getBackupFiles(): array |
|
42 | { |
||
43 | 1 | $items = $this->client->listFolder($this->path, ['limit' => 100]); |
|
44 | 1 | foreach ($items->getItems() as $item) { |
|
45 | // skip directories |
||
46 | 1 | if ($item instanceof \Kunnu\Dropbox\Models\FolderMetadata) { |
|
47 | continue; |
||
48 | } |
||
49 | /** @var \Kunnu\Dropbox\Models\FileMetadata $item */ |
||
50 | // skip currently created backup |
||
51 | 1 | if ($item->getPathDisplay() == $this->path . $this->target->getFilename()) { |
|
52 | 1 | continue; |
|
53 | } |
||
54 | 1 | if ($this->isFilenameMatch($item->getName())) { |
|
55 | 1 | $this->files[] = new \phpbu\App\Backup\File\Dropbox($this->client, $item); |
|
56 | } |
||
57 | } |
||
58 | |||
59 | 1 | return $this->files; |
|
60 | } |
||
61 | } |