Code Duplication    Length = 13-13 lines in 2 locations

src/Webcreate/Conveyor/Transporter/RsyncTransporter.php 1 location

@@ 37-49 (lines=13) @@
34
     * @param  string $path remote source path
35
     * @return bool   true when the resource exists, false otherwise
36
     */
37
    public function exists($path)
38
    {
39
        if (false === isset($this->_exists[$path])) {
40
            $remoteCommand = sprintf("test -e %s", $path);
41
            $commandline   = sprintf("ssh %s@%s \"%s\"", $this->getUser(), $this->getHost(), $remoteCommand);
42
43
            $exitCode = $this->cli->execute($commandline);
44
45
            $this->_exists[$path] = (0 === $exitCode);
46
        }
47
48
        return $this->_exists[$path];
49
    }
50
51
    /**
52
     * Create a directory on the remote server

src/Webcreate/Conveyor/Transporter/ScpTransporter.php 1 location

@@ 37-49 (lines=13) @@
34
     * @param  string $path remote source path
35
     * @return bool   true when the resource exists, false otherwise
36
     */
37
    public function exists($path)
38
    {
39
        if (false === isset($this->_exists[$path])) {
40
            $remoteCommand = sprintf("test -e %s", $path);
41
            $commandline   = sprintf("ssh %s@%s \"%s\"", $this->getUser(), $this->getHost(), $remoteCommand);
42
43
            $exitCode = $this->cli->execute($commandline);
44
45
            $this->_exists[$path] = (0 === $exitCode);
46
        }
47
48
        return $this->_exists[$path];
49
    }
50
51
    /**
52
     * Create a directory on the remote server