@@ -936,7 +936,9 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -386,9 +386,13 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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) |
@@ -205,12 +205,16 @@ |
||
| 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( |
@@ -923,7 +923,9 @@ discard block |
||
| 923 | 923 | * @return SS_List |
| 924 | 924 | */ |
| 925 | 925 | public function whoIsAllowedAny($codes) { |
| 926 | - if(!is_array($codes)) $codes = array($codes); |
|
| 926 | + if(!is_array($codes)) { |
|
| 927 | + $codes = array($codes); |
|
| 928 | + } |
|
| 927 | 929 | |
| 928 | 930 | $SQLa_codes = Convert::raw2sql($codes); |
| 929 | 931 | $SQL_codes = join("','", $SQLa_codes); |
@@ -985,7 +987,9 @@ discard block |
||
| 985 | 987 | $member = Member::currentUser(); |
| 986 | 988 | } |
| 987 | 989 | |
| 988 | - if(Permission::checkMember($member, 'ADMIN')) return true; |
|
| 990 | + if(Permission::checkMember($member, 'ADMIN')) { |
|
| 991 | + return true; |
|
| 992 | + } |
|
| 989 | 993 | |
| 990 | 994 | $hits = $this->whoIsAllowedAny($codes)->filter('Member.ID', $member->ID)->count(); |
| 991 | 995 | return ($hits>0 ? true : false); |
@@ -1012,7 +1016,9 @@ discard block |
||
| 1012 | 1016 | }); |
| 1013 | 1017 | |
| 1014 | 1018 | // If anything returns false then we're not ready. |
| 1015 | - if($isDone) return min($isDone); |
|
| 1019 | + if($isDone) { |
|
| 1020 | + return min($isDone); |
|
| 1021 | + } |
|
| 1016 | 1022 | } |
| 1017 | 1023 | |
| 1018 | 1024 | return true; |