Code Duplication    Length = 12-12 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 2 locations

@@ 291-302 (lines=12) @@
288
		$databasePath = $filepathBase . DIRECTORY_SEPARATOR . 'database.sql';
289
290
		// Backup database
291
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {
292
			$log->write(sprintf('Backup of database from "%s" started', $name));
293
			$command = $this->getCommand('data:getdb', 'db', $environment, array('data_path' => $databasePath), $log);
294
			$command->run(function($type, $buffer) use($log) {
295
				$log->write($buffer);
296
			});
297
			if(!$command->isSuccessful()) {
298
				$this->extend('dataTransferFailure', $environment, $log);
299
				throw new RuntimeException($command->getErrorOutput());
300
			}
301
			$log->write(sprintf('Backup of database from "%s" done', $name));
302
		}
303
304
		// Backup assets
305
		if(in_array($dataTransfer->Mode, array('all', 'assets'))) {
@@ 305-316 (lines=12) @@
302
		}
303
304
		// Backup assets
305
		if(in_array($dataTransfer->Mode, array('all', 'assets'))) {
306
			$log->write(sprintf('Backup of assets from "%s" started', $name));
307
			$command = $this->getCommand('data:getassets', 'web', $environment, array('data_path' => $filepathBase), $log);
308
			$command->run(function($type, $buffer) use($log) {
309
				$log->write($buffer);
310
			});
311
			if(!$command->isSuccessful()) {
312
				$this->extend('dataTransferFailure', $environment, $log);
313
				throw new RuntimeException($command->getErrorOutput());
314
			}
315
			$log->write(sprintf('Backup of assets from "%s" done', $name));
316
		}
317
318
		$sspakFilename = sprintf('%s.sspak', $dataArchive->generateFilename($dataTransfer));
319
		$sspakFilepath = $filepathBase . DIRECTORY_SEPARATOR . $sspakFilename;