Code Duplication    Length = 12-12 lines in 3 locations

code/backends/CapistranoDeploymentBackend.php 3 locations

@@ 130-141 (lines=12) @@
127
	/**
128
	 * Enable a maintenance page for the given environment using the maintenance:enable Capistrano task.
129
	 */
130
	public function enableMaintenance(DNEnvironment $environment, DeploynautLogFile $log, DNProject $project) {
131
		$name = $environment->getFullName();
132
		$command = $this->getCommand('maintenance:enable', 'web', $environment, null, $log);
133
		$command->run(function($type, $buffer) use($log) {
134
			$log->write($buffer);
135
		});
136
		if(!$command->isSuccessful()) {
137
			$this->extend('maintenanceEnableFailure', $environment, $log);
138
			throw new RuntimeException($command->getErrorOutput());
139
		}
140
		$log->write(sprintf('Maintenance page enabled on "%s"', $name));
141
	}
142
143
	/**
144
	 * Disable the maintenance page for the given environment using the maintenance:disable Capistrano task.
@@ 146-157 (lines=12) @@
143
	/**
144
	 * Disable the maintenance page for the given environment using the maintenance:disable Capistrano task.
145
	 */
146
	public function disableMaintenance(DNEnvironment $environment, DeploynautLogFile $log, DNProject $project) {
147
		$name = $environment->getFullName();
148
		$command = $this->getCommand('maintenance:disable', 'web', $environment, null, $log);
149
		$command->run(function($type, $buffer) use($log) {
150
			$log->write($buffer);
151
		});
152
		if(!$command->isSuccessful()) {
153
			$this->extend('maintenanceDisableFailure', $environment, $log);
154
			throw new RuntimeException($command->getErrorOutput());
155
		}
156
		$log->write(sprintf('Maintenance page disabled on "%s"', $name));
157
	}
158
159
	/**
160
	 * Check the status using the deploy:check capistrano method
@@ 347-358 (lines=12) @@
344
	 * Also cleans up and generates new error pages.
345
	 * @param DeploynautLogFile $log
346
	 */
347
	public function rebuild(DNEnvironment $environment, $log) {
348
		$name = $environment->getFullName();
349
		$command = $this->getCommand('deploy:migrate', 'web', $environment, null, $log);
350
		$command->run(function($type, $buffer) use($log) {
351
			$log->write($buffer);
352
		});
353
		if(!$command->isSuccessful()) {
354
			$log->write(sprintf('Rebuild of "%s" failed: %s', $name, $command->getErrorOutput()));
355
			throw new RuntimeException($command->getErrorOutput());
356
		}
357
		$log->write(sprintf('Rebuild of "%s" done', $name));
358
	}
359
360
	/**
361
	 * Extracts a *.sspak file referenced through the passed in $dataTransfer