Code Duplication    Length = 11-11 lines in 2 locations

src/Backup/Sync/Ftp.php 1 location

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

src/Backup/Sync/Sftp.php 1 location

@@ 85-95 (lines=11) @@
82
        // silence phpseclib
83
        $old  = error_reporting(0);
84
        $sftp = new phpseclib\Net\SFTP($this->host);
85
        if (!$sftp->login($this->user, $this->password)) {
86
            error_reporting($old);
87
            throw new Exception(
88
                sprintf(
89
                    'authentication failed for %s@%s%s',
90
                    $this->user,
91
                    $this->host,
92
                    empty($this->password) ? '' : ' with password ****'
93
                )
94
            );
95
        }
96
        // restore old error reporting
97
        error_reporting($old);
98