Code Duplication    Length = 12-12 lines in 3 locations

code/backends/CapistranoDeploymentBackend.php 3 locations

@@ 178-189 (lines=12) @@
175
	/**
176
	 * Enable a maintenance page for the given environment using the maintenance:enable Capistrano task.
177
	 */
178
	public function enableMaintenance(\DNEnvironment $environment, \DeploynautLogFile $log, \DNProject $project) {
179
		$name = $environment->getFullName();
180
		$command = $this->getCommand('maintenance:enable', 'web', $environment, null, $log);
181
		$command->run(function($type, $buffer) use($log) {
182
			$log->write($buffer);
183
		});
184
		if(!$command->isSuccessful()) {
185
			$this->extend('maintenanceEnableFailure', $environment, $log);
186
			throw new RuntimeException($command->getErrorOutput());
187
		}
188
		$log->write(sprintf('Maintenance page enabled on "%s"', $name));
189
	}
190
191
	/**
192
	 * Disable the maintenance page for the given environment using the maintenance:disable Capistrano task.
@@ 194-205 (lines=12) @@
191
	/**
192
	 * Disable the maintenance page for the given environment using the maintenance:disable Capistrano task.
193
	 */
194
	public function disableMaintenance(\DNEnvironment $environment, \DeploynautLogFile $log, \DNProject $project) {
195
		$name = $environment->getFullName();
196
		$command = $this->getCommand('maintenance:disable', 'web', $environment, null, $log);
197
		$command->run(function($type, $buffer) use($log) {
198
			$log->write($buffer);
199
		});
200
		if(!$command->isSuccessful()) {
201
			$this->extend('maintenanceDisableFailure', $environment, $log);
202
			throw new RuntimeException($command->getErrorOutput());
203
		}
204
		$log->write(sprintf('Maintenance page disabled on "%s"', $name));
205
	}
206
207
	/**
208
	 * Check the status using the deploy:check capistrano method
@@ 405-416 (lines=12) @@
402
	 * Also cleans up and generates new error pages.
403
	 * @param DeploynautLogFile $log
404
	 */
405
	public function rebuild(\DNEnvironment $environment, $log) {
406
		$name = $environment->getFullName();
407
		$command = $this->getCommand('deploy:migrate', 'web', $environment, null, $log);
408
		$command->run(function($type, $buffer) use($log) {
409
			$log->write($buffer);
410
		});
411
		if(!$command->isSuccessful()) {
412
			$log->write(sprintf('Rebuild of "%s" failed: %s', $name, $command->getErrorOutput()));
413
			throw new RuntimeException($command->getErrorOutput());
414
		}
415
		$log->write(sprintf('Rebuild of "%s" done', $name));
416
	}
417
418
	/**
419
	 * Extracts a *.sspak file referenced through the passed in $dataTransfer