Code Duplication    Length = 11-11 lines in 2 locations

src/Backup/Sync/Ftp.php 1 location

@@ 65-75 (lines=11) @@
62
            );
63
        }
64
65
        if (!ftp_login($ftpConnection, $this->user, $this->password)) {
66
            error_reporting($old);
67
            throw new Exception(
68
                sprintf(
69
                    'authentication failed for %s@%s%s',
70
                    $this->user,
71
                    $this->host,
72
                    empty($this->password) ? '' : ' with password ****'
73
                )
74
            );
75
        }
76
77
        $remoteFilename = $target->getFilename();
78
        $localFile      = $target->getPathname();

src/Backup/Sync/Sftp.php 1 location

@@ 59-69 (lines=11) @@
56
        // silence phpseclib
57
        $old  = error_reporting(0);
58
        $sftp = new phpseclib\Net\SFTP($this->host);
59
        if (!$sftp->login($this->user, $this->password)) {
60
            error_reporting($old);
61
            throw new Exception(
62
                sprintf(
63
                    'authentication failed for %s@%s%s',
64
                    $this->user,
65
                    $this->host,
66
                    empty($this->password) ? '' : ' with password ****'
67
                )
68
            );
69
        }
70
        error_reporting($old);
71
72
        $remoteFilename = $target->getFilename();