Code Duplication    Length = 12-12 lines in 3 locations

code/backends/CapistranoDeploymentBackend.php 3 locations

@@ 168-179 (lines=12) @@
165
	/**
166
	 * Enable a maintenance page for the given environment using the maintenance:enable Capistrano task.
167
	 */
168
	public function enableMaintenance(DNEnvironment $environment, DeploynautLogFile $log, DNProject $project) {
169
		$name = $environment->getFullName();
170
		$command = $this->getCommand('maintenance:enable', 'web', $environment, null, $log);
171
		$command->run(function($type, $buffer) use($log) {
172
			$log->write($buffer);
173
		});
174
		if(!$command->isSuccessful()) {
175
			$this->extend('maintenanceEnableFailure', $environment, $log);
176
			throw new RuntimeException($command->getErrorOutput());
177
		}
178
		$log->write(sprintf('Maintenance page enabled on "%s"', $name));
179
	}
180
181
	/**
182
	 * Disable the maintenance page for the given environment using the maintenance:disable Capistrano task.
@@ 184-195 (lines=12) @@
181
	/**
182
	 * Disable the maintenance page for the given environment using the maintenance:disable Capistrano task.
183
	 */
184
	public function disableMaintenance(DNEnvironment $environment, DeploynautLogFile $log, DNProject $project) {
185
		$name = $environment->getFullName();
186
		$command = $this->getCommand('maintenance:disable', 'web', $environment, null, $log);
187
		$command->run(function($type, $buffer) use($log) {
188
			$log->write($buffer);
189
		});
190
		if(!$command->isSuccessful()) {
191
			$this->extend('maintenanceDisableFailure', $environment, $log);
192
			throw new RuntimeException($command->getErrorOutput());
193
		}
194
		$log->write(sprintf('Maintenance page disabled on "%s"', $name));
195
	}
196
197
	/**
198
	 * Check the status using the deploy:check capistrano method
@@ 395-406 (lines=12) @@
392
	 * Also cleans up and generates new error pages.
393
	 * @param DeploynautLogFile $log
394
	 */
395
	public function rebuild(DNEnvironment $environment, $log) {
396
		$name = $environment->getFullName();
397
		$command = $this->getCommand('deploy:migrate', 'web', $environment, null, $log);
398
		$command->run(function($type, $buffer) use($log) {
399
			$log->write($buffer);
400
		});
401
		if(!$command->isSuccessful()) {
402
			$log->write(sprintf('Rebuild of "%s" failed: %s', $name, $command->getErrorOutput()));
403
			throw new RuntimeException($command->getErrorOutput());
404
		}
405
		$log->write(sprintf('Rebuild of "%s" done', $name));
406
	}
407
408
	/**
409
	 * Extracts a *.sspak file referenced through the passed in $dataTransfer