Code Duplication    Length = 11-11 lines in 2 locations

src/Backup/Sync/Ftp.php 1 location

@@ 81-91 (lines=11) @@
78
            );
79
        }
80
81
        if (!ftp_login($ftpConnection, $this->user, $this->password)) {
82
            error_reporting($old);
83
            throw new Exception(
84
                sprintf(
85
                    'authentication failed for %s@%s%s',
86
                    $this->user,
87
                    $this->host,
88
                    empty($this->password) ? '' : ' with password ****'
89
                )
90
            );
91
        }
92
93
        $remoteFilename = $target->getFilename();
94
        $localFile      = $target->getPathname();

src/Backup/Sync/Sftp.php 1 location

@@ 109-119 (lines=11) @@
106
        // silence phpseclib
107
        $old  = error_reporting(0);
108
        $sftp = new phpseclib\Net\SFTP($this->host);
109
        if (!$sftp->login($this->user, $this->password)) {
110
            error_reporting($old);
111
            throw new Exception(
112
                sprintf(
113
                    'authentication failed for %s@%s%s',
114
                    $this->user,
115
                    $this->host,
116
                    empty($this->password) ? '' : ' with password ****'
117
                )
118
            );
119
        }
120
        // restore old error reporting
121
        error_reporting($old);
122