Code Duplication    Length = 7-8 lines in 2 locations

SFTP/SFTP.php 2 locations

@@ 56-63 (lines=8) @@
53
    /**
54
     * @inheritdoc
55
     */
56
    public function fetchFrom($remoteFile, $localFile)
57
    {
58
        $remoteData = file_get_contents('ssh2.sftp://' . intval($this->sftp) . $remoteFile);
59
        if (!$remoteData) {
60
            throw new \Exception('File can`t be loaded from the SFTP server.');
61
        }
62
        file_put_contents($localFile, $remoteData);
63
    }
64
65
    /**
66
     * @inheritdoc
@@ 68-74 (lines=7) @@
65
    /**
66
     * @inheritdoc
67
     */
68
    public function sendTo($localFile, $remoteFile)
69
    {
70
        $localData = file_get_contents($localFile);
71
        if (!file_put_contents("ssh2.sftp://" . intval($this->sftp) . $remoteFile, $localData)) {
72
            throw new \Exception('File could not be uploaded to the SFTP server.');
73
        }
74
    }
75
76
    /**
77
     * @inheritdoc