Code Duplication    Length = 17-17 lines in 2 locations

src/dumpers/MysqlDumper.php 2 locations

@@ 111-127 (lines=17) @@
108
        $process->mustRun();
109
    }
110
111
    public function dump($file)
112
    {
113
        $defaultsFileName = $this->createMysqlDefaultsFile();
114
115
        try {
116
            $this->runCommand(
117
                escapeshellcmd($this->mysqldumpPath)
118
                .' --defaults-extra-file='.escapeshellarg($defaultsFileName)
119
                .' '.escapeshellarg($this->dsn['dbname'])
120
                .' > '.escapeshellarg($file)
121
            );
122
        } catch (ProcessFailedException $e) {
123
            unlink($defaultsFileName);
124
125
            throw new Exception('mysqldump failed: '.$e->getProcess()->getErrorOutput());
126
        }
127
    }
128
129
    public function restore($file)
130
    {
@@ 129-145 (lines=17) @@
126
        }
127
    }
128
129
    public function restore($file)
130
    {
131
        $defaultsFileName = $this->createMysqlDefaultsFile();
132
133
        try {
134
            $this->runCommand(
135
                escapeshellcmd($this->mysqlPath)
136
                .' --defaults-extra-file='.escapeshellarg($defaultsFileName)
137
                .' '.escapeshellarg($this->dsn['dbname'])
138
                .' < '.escapeshellarg($file)
139
            );
140
        } catch (ProcessFailedException $e) {
141
            unlink($defaultsFileName);
142
143
            throw new Exception('mysql failed: '.$e->getProcess()->getErrorOutput());
144
        }
145
    }
146
}
147