Code Duplication    Length = 7-7 lines in 2 locations

code/control/DNRoot.php 1 location

@@ 473-479 (lines=7) @@
470
		$dataArchive->write();
471
		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
472
473
		$cleanupFn = function() use($workingDir, $dataTransfer, $dataArchive) {
474
			$process = new Process(sprintf('rm -rf %s', escapeshellarg($workingDir)));
475
			$process->setTimeout(120);
476
			$process->run();
477
			$dataTransfer->delete();
478
			$dataArchive->delete();
479
		};
480
481
		// extract the sspak contents so we can inspect them
482
		try {

code/backends/CapistranoDeploymentBackend.php 1 location

@@ 413-419 (lines=7) @@
410
411
		// Rollback cleanup.
412
		$self = $this;
413
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
414
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
415
			$self->rebuild($environment, $log);
416
			$process = new Process(sprintf('rm -rf %s', escapeshellarg($workingDir)));
417
			$process->setTimeout(120);
418
			$process->run();
419
		};
420
421
		// Restore database into target environment
422
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {