Code Duplication    Length = 17-17 lines in 3 locations

code/model/jobs/DNCreateEnvironment.php 1 location

@@ 109-125 (lines=17) @@
106
	 *
107
	 * @return string
108
	 */
109
	public function ResqueStatus() {
110
		$status = new Resque_Job_Status($this->ResqueToken);
111
		$statusCode = $status->get();
112
		// The Resque job can no longer be found, fallback to the DNDeployment.Status
113
		if($statusCode === false) {
114
			// Translate from the DNDeployment.Status to the Resque job status for UI purposes
115
			switch($this->Status) {
116
				case 'Finished':
117
					return 'Complete';
118
				case 'Started':
119
					return 'Running';
120
				default:
121
					return $this->Status;
122
			}
123
		}
124
		return self::map_resque_status($statusCode);
125
	}
126
127
	/**
128
	 * Start a resque job for this creation.

code/model/jobs/DNDataTransfer.php 1 location

@@ 273-289 (lines=17) @@
270
	 *
271
	 * @return string
272
	 */
273
	public function ResqueStatus() {
274
		$status = new Resque_Job_Status($this->ResqueToken);
275
		$statusCode = $status->get();
276
		// The Resque job can no longer be found, fallback to the DNDataTransfer.Status
277
		if($statusCode === false) {
278
			// Translate from the DNDataTransfer.Status to the Resque job status for UI purposes
279
			switch($this->Status) {
280
				case 'Finished':
281
					return 'Complete';
282
				case 'Started':
283
					return 'Running';
284
				default:
285
					return $this->Status;
286
			}
287
		}
288
		return self::map_resque_status($statusCode);
289
	}
290
291
}
292

code/model/jobs/DNDeployment.php 1 location

@@ 111-127 (lines=17) @@
108
	 *
109
	 * @return string
110
	 */
111
	public function ResqueStatus() {
112
		$status = new Resque_Job_Status($this->ResqueToken);
113
		$statusCode = $status->get();
114
		// The Resque job can no longer be found, fallback to the DNDeployment.Status
115
		if($statusCode === false) {
116
			// Translate from the DNDeployment.Status to the Resque job status for UI purposes
117
			switch($this->Status) {
118
				case 'Finished':
119
					return 'Complete';
120
				case 'Started':
121
					return 'Running';
122
				default:
123
					return $this->Status;
124
			}
125
		}
126
		return self::map_resque_status($statusCode);
127
	}
128
129
130
	/**