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

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