Code Duplication    Length = 9-12 lines in 2 locations

src/Backup/Collector/AmazonS3v3.php 1 location

@@ 69-77 (lines=9) @@
66
            return [];
67
        }
68
69
        foreach ($result['Contents'] as $object) {
70
            // skip currently created backup
71
            if ($object['Key'] == $this->getPrefix() . $this->target->getFilename()) {
72
                continue;
73
            }
74
            if ($this->isFileMatch($object['Key'])) {
75
                $this->files[] = new AwsFile($this->client, $this->bucket, $object);
76
            }
77
        }
78
79
        return $this->files;
80
    }

src/Backup/Collector/Sftp.php 1 location

@@ 55-66 (lines=12) @@
52
    public function getBackupFiles(): array
53
    {
54
        $list = $this->sftp->_list($this->path);
55
        foreach ($list as $fileInfo) {
56
            if ($fileInfo['type'] === 2) {
57
                continue;
58
            }
59
            // skip currently created backup
60
            if ($fileInfo['filename'] == $this->target->getFilename()) {
61
                continue;
62
            }
63
            if ($this->isFilenameMatch($fileInfo['filename'])) {
64
                $this->files[] = new \phpbu\App\Backup\File\Sftp($this->sftp, $fileInfo, $this->path);
65
            }
66
        }
67
68
        return $this->files;
69
    }