Code Duplication    Length = 11-12 lines in 3 locations

code/model/jobs/DNDeployment.php 3 locations

@@ 176-187 (lines=12) @@
173
	 *
174
	 * @return \Gitonomy\Git\Commit|null
175
	 */
176
	public function getCommit() {
177
		$repo = $this->getRepository();
178
		if($repo) {
179
			try {
180
				return $this->Environment()->getCommit($this->SHA);
181
			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $ex) {
182
				return null;
183
			}
184
		}
185
186
		return null;
187
	}
188
189
	/**
190
	 * Get the commit URL to the commit associated with this deployment.
@@ 214-224 (lines=11) @@
211
	 *
212
	 * @return string|null
213
	 */
214
	public function getCommitMessage() {
215
		$commit = $this->getCommit();
216
		if($commit) {
217
			try {
218
				return Convert::raw2xml($this->Environment()->getCommitMessage($commit));
219
			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $e) {
220
				return null;
221
			}
222
		}
223
		return null;
224
	}
225
226
	/**
227
	 * Gets the commit message.
@@ 231-241 (lines=11) @@
228
	 *
229
	 * @return string|null
230
	 */
231
	public function getCommitSubjectMessage() {
232
		$commit = $this->getCommit();
233
		if($commit) {
234
			try {
235
				return Convert::raw2xml($this->Environment()->getCommitSubjectMessage($commit));
236
			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $e) {
237
				return null;
238
			}
239
		}
240
		return null;
241
	}
242
243
	/**
244
	 * Return all tags for the deployed commit.