Completed
Pull Request — master (#714)
by Stig
05:38
created
code/model/jobs/DNDeployment.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	}
112 112
 
113 113
 	public function LogLink() {
114
-		return $this->Link() . '/log';
114
+		return $this->Link().'/log';
115 115
 	}
116 116
 
117 117
 	public function canView($member = null) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return \Gitonomy\Git\Repository|null
158 158
 	 */
159 159
 	public function getRepository() {
160
-		if(!$this->SHA) {
160
+		if (!$this->SHA) {
161 161
 			return null;
162 162
 		}
163 163
 		return $this->Environment()->Project()->getRepository();
@@ -170,10 +170,10 @@  discard block
 block discarded – undo
170 170
 	 */
171 171
 	public function getCommit() {
172 172
 		$repo = $this->getRepository();
173
-		if($repo) {
173
+		if ($repo) {
174 174
 			try {
175 175
 				return $this->Environment()->getCommit($this->SHA);
176
-			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $ex) {
176
+			} catch (Gitonomy\Git\Exception\ReferenceNotFoundException $ex) {
177 177
 				return null;
178 178
 			}
179 179
 		}
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		if (!$interface) {
199 199
 			return null;
200 200
 		}
201
-		return $interface->CommitURL . '/' . $this->SHA;
201
+		return $interface->CommitURL.'/'.$this->SHA;
202 202
 	}
203 203
 
204 204
 	/**
@@ -208,10 +208,10 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public function getCommitMessage() {
210 210
 		$commit = $this->getCommit();
211
-		if($commit) {
211
+		if ($commit) {
212 212
 			try {
213 213
 				return Convert::raw2xml($this->Environment()->getCommitMessage($commit));
214
-			} catch(Gitonomy\Git\Exception\ReferenceNotFoundException $e) {
214
+			} catch (Gitonomy\Git\Exception\ReferenceNotFoundException $e) {
215 215
 				return null;
216 216
 			}
217 217
 		}
@@ -225,13 +225,13 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	public function getTags() {
227 227
 		$commit = $this->Environment()->getCommit($this->SHA);
228
-		if(!$commit) {
228
+		if (!$commit) {
229 229
 			return new ArrayList([]);
230 230
 		}
231 231
 		$tags = $this->Environment()->getCommitTags($commit);
232 232
 		$returnTags = [];
233 233
 		if (!empty($tags)) {
234
-			foreach($tags as $tag) {
234
+			foreach ($tags as $tag) {
235 235
 				$field = Varchar::create('Tag', '255');
236 236
 				$field->setValue($tag->getName());
237 237
 				$returnTags[] = $field;
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function getFullDeployMessages() {
250 250
 		$strategy = $this->getDeploymentStrategy();
251
-		if ($strategy->getActionCode()!=='full') return null;
251
+		if ($strategy->getActionCode() !== 'full') return null;
252 252
 
253 253
 		$changes = $strategy->getChangesModificationNeeded();
254 254
 		$messages = [];
255 255
 		foreach ($changes as $change => $details) {
256
-			if ($change==='Code version') continue;
256
+			if ($change === 'Code version') continue;
257 257
 
258 258
 			$messages[] = [
259 259
 				'Flag' => sprintf(
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	public function getTag() {
283 283
 		$tags = $this->getTags();
284
-		if($tags->count() > 0) {
284
+		if ($tags->count() > 0) {
285 285
 			return $tags->last();
286 286
 		}
287 287
 		return null;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	public function getChanges() {
307 307
 		$list = new ArrayList();
308 308
 		$strategy = $this->getDeploymentStrategy();
309
-		foreach($strategy->getChanges() as $name => $change) {
309
+		foreach ($strategy->getChanges() as $name => $change) {
310 310
 			$changed = (isset($change['from']) && isset($change['to'])) ? $change['from'] != $change['to'] : null;
311 311
 			$description = isset($change['description']) ? $change['description'] : '';
312 312
 			$compareUrl = null;
@@ -356,11 +356,11 @@  discard block
 block discarded – undo
356 356
 		// Make sure we use the SHA as it was written into this DNDeployment.
357 357
 		$args['sha'] = $this->SHA;
358 358
 
359
-		if(!$this->DeployerID) {
359
+		if (!$this->DeployerID) {
360 360
 			$this->DeployerID = Member::currentUserID();
361 361
 		}
362 362
 
363
-		if($this->DeployerID) {
363
+		if ($this->DeployerID) {
364 364
 			$deployer = $this->Deployer();
365 365
 			$message = sprintf(
366 366
 				'Deploy to %s initiated by %s (%s), with IP address %s',
Please login to merge, or discard this patch.