Completed
Pull Request — master (#421)
by Michael
1346:13 queued 1341:51
created
code/backends/DeploymentStrategy.php 1 patch
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -75,6 +75,7 @@  discard block
 block discarded – undo
75 75
 	}
76 76
 
77 77
 	/**
78
+	 * @param string $code
78 79
 	 */
79 80
 	public function setActionCode($code) {
80 81
 		$this->actionCode = $code;
@@ -89,6 +90,7 @@  discard block
 block discarded – undo
89 90
 
90 91
 	/**
91 92
 	 * @param int
93
+	 * @param string $seconds
92 94
 	 */
93 95
 	public function setEstimatedTime($seconds) {
94 96
 		$this->estimatedTime = $seconds;
Please login to merge, or discard this patch.
code/control/DNRoot.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
 	 * @param array $data
964 964
 	 * @param Form $form
965 965
 	 *
966
-	 * @return bool|HTMLText|SS_HTTPResponse
966
+	 * @return SS_HTTPResponse|null
967 967
 	 */
968 968
 	public function doCreateEnvironment($data, Form $form) {
969 969
 		$this->setCurrentActionType(self::ACTION_ENVIRONMENTS);
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 	/**
2352 2352
 	 * Create project action.
2353 2353
 	 *
2354
-	 * @return SS_HTTPResponse
2354
+	 * @return HTMLText
2355 2355
 	 */
2356 2356
 	public function createproject(SS_HTTPRequest $request) {
2357 2357
 		if($this->canCreateProjects()) {
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -936,7 +936,9 @@  discard block
 block discarded – undo
936 936
 		}
937 937
 
938 938
 		$fields = $backend->getCreateEnvironmentFields($project);
939
-		if(!$fields) return null;
939
+		if(!$fields) {
940
+			return null;
941
+		}
940 942
 
941 943
 		if(!$project->canCreateEnvironments()) {
942 944
 			return new SS_HTTPResponse('Not allowed to create environments for this project', 401);
@@ -2366,8 +2368,12 @@  discard block
 block discarded – undo
2366 2368
 	 * @return bool
2367 2369
 	 */
2368 2370
 	public function canCreateProjects($member = null) {
2369
-		if(!$member) $member = Member::currentUser();
2370
-		if(!$member) return false;
2371
+		if(!$member) {
2372
+			$member = Member::currentUser();
2373
+		}
2374
+		if(!$member) {
2375
+			return false;
2376
+		}
2371 2377
 
2372 2378
 		return singleton('DNProject')->canCreate($member);
2373 2379
 	}
Please login to merge, or discard this patch.
code/model/DNEnvironment.php 1 patch
Braces   +36 added lines, -12 removed lines patch added patch discarded remove patch
@@ -386,9 +386,13 @@  discard block
 block discarded – undo
386 386
 		// Must be logged in to check permissions
387 387
 
388 388
 		if ($this->Usage==='Production' || $this->Usage==='Unspecified') {
389
-			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_DEPLOYMENT, $member)) return true;
389
+			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_DEPLOYMENT, $member)) {
390
+				return true;
391
+			}
390 392
 		} else {
391
-			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_DEPLOYMENT, $member)) return true;
393
+			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_DEPLOYMENT, $member)) {
394
+				return true;
395
+			}
392 396
 		}
393 397
 
394 398
 		return $this->Deployers()->byID($member->ID)
@@ -412,9 +416,13 @@  discard block
 block discarded – undo
412 416
 		// Must be logged in to check permissions
413 417
 
414 418
 		if ($this->Usage==='Production' || $this->Usage==='Unspecified') {
415
-			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true;
419
+			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) {
420
+				return true;
421
+			}
416 422
 		} else {
417
-			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true;
423
+			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) {
424
+				return true;
425
+			}
418 426
 		}
419 427
 
420 428
 		return $this->CanRestoreMembers()->byID($member->ID)
@@ -443,9 +451,13 @@  discard block
 block discarded – undo
443 451
 		}
444 452
 
445 453
 		if ($this->Usage==='Production' || $this->Usage==='Unspecified') {
446
-			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true;
454
+			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) {
455
+				return true;
456
+			}
447 457
 		} else {
448
-			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true;
458
+			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) {
459
+				return true;
460
+			}
449 461
 		}
450 462
 
451 463
 		return $this->CanBackupMembers()->byID($member->ID)
@@ -478,9 +490,13 @@  discard block
 block discarded – undo
478 490
 		// Must be logged in to check permissions
479 491
 
480 492
 		if ($this->Usage==='Production' || $this->Usage==='Unspecified') {
481
-			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true;
493
+			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) {
494
+				return true;
495
+			}
482 496
 		} else {
483
-			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true;
497
+			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) {
498
+				return true;
499
+			}
484 500
 		}
485 501
 
486 502
 		return $this->ArchiveUploaders()->byID($member->ID)
@@ -504,9 +520,13 @@  discard block
 block discarded – undo
504 520
 		// Must be logged in to check permissions
505 521
 
506 522
 		if ($this->Usage==='Production' || $this->Usage==='Unspecified') {
507
-			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true;
523
+			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) {
524
+				return true;
525
+			}
508 526
 		} else {
509
-			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true;
527
+			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) {
528
+				return true;
529
+			}
510 530
 		}
511 531
 
512 532
 		return $this->ArchiveDownloaders()->byID($member->ID)
@@ -573,9 +593,13 @@  discard block
 block discarded – undo
573 593
 		// Must be logged in to check permissions
574 594
 
575 595
 		if ($this->Usage==='Production' || $this->Usage==='Unspecified') {
576
-			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) return true;
596
+			if ($this->Project()->allowed(DNRoot::ALLOW_PROD_SNAPSHOT, $member)) {
597
+				return true;
598
+			}
577 599
 		} else {
578
-			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) return true;
600
+			if ($this->Project()->allowed(DNRoot::ALLOW_NON_PROD_SNAPSHOT, $member)) {
601
+				return true;
602
+			}
579 603
 		}
580 604
 
581 605
 		return $this->ArchiveDeleters()->byID($member->ID)
Please login to merge, or discard this patch.
code/model/jobs/DNDeployment.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -205,12 +205,16 @@
 block discarded – undo
205 205
 	 */
206 206
 	public function getFullDeployMessages() {
207 207
 		$strategy = $this->getDeploymentStrategy();
208
-		if ($strategy->getActionCode()!=='full') return null;
208
+		if ($strategy->getActionCode()!=='full') {
209
+			return null;
210
+		}
209 211
 
210 212
 		$changes = $strategy->getChangesModificationNeeded();
211 213
 		$messages = [];
212 214
 		foreach ($changes as $change => $details) {
213
-			if ($change==='Code version') continue;
215
+			if ($change==='Code version') {
216
+				continue;
217
+			}
214 218
 
215 219
 			$messages[] = [
216 220
 				'Flag' => sprintf(
Please login to merge, or discard this patch.
code/model/DNProject.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 	}
446 446
 
447 447
 	/**
448
-	 * @return false|Gitonomy\Git\Repository
448
+	 * @return Gitonomy\Git\Repository
449 449
 	 */
450 450
 	public function getRepository() {
451 451
 		if(!$this->repoExists()) {
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 	/**
954 954
 	 * Check if member has a permission code in this project.
955 955
 	 *
956
-	 * @param string $code
956
+	 * @param string $codes
957 957
 	 * @param Member|null $member
958 958
 	 *
959 959
 	 * @return bool
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -921,7 +921,9 @@  discard block
 block discarded – undo
921 921
 	 * @return SS_List
922 922
 	 */
923 923
 	public function whoIsAllowedAny($codes) {
924
-		if(!is_array($codes)) $codes = array($codes);
924
+		if(!is_array($codes)) {
925
+			$codes = array($codes);
926
+		}
925 927
 
926 928
 		$SQLa_codes = Convert::raw2sql($codes);
927 929
 		$SQL_codes = join("','", $SQLa_codes);
@@ -963,7 +965,9 @@  discard block
 block discarded – undo
963 965
 			$member = Member::currentUser();
964 966
 		}
965 967
 
966
-		if(Permission::checkMember($member, 'ADMIN')) return true;
968
+		if(Permission::checkMember($member, 'ADMIN')) {
969
+			return true;
970
+		}
967 971
 
968 972
 		$hits = $this->whoIsAllowedAny($codes)->filter('Member.ID', $member->ID)->count();
969 973
 		return ($hits>0 ? true : false);
Please login to merge, or discard this patch.