Skip to content

Commit

Permalink
fixing code analysis: removing unnecessary parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerkrauss committed Jun 1, 2017
1 parent e7ad086 commit 4fc13b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/extensions/LeftAndMainSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public function copytosubsite($data, $form)
{
$page = DataObject::get_by_id(SiteTree::class, $data['ID']);
$subsite = DataObject::get_by_id('Subsite', $data['CopyToSubsiteID']);
$includeChildren = (isset($data['CopyToSubsiteWithChildren'])) ? $data['CopyToSubsiteWithChildren'] : false;
$includeChildren = isset($data['CopyToSubsiteWithChildren']) ? $data['CopyToSubsiteWithChildren'] : false;

$newPage = $page->duplicateToSubsite($subsite->ID, $includeChildren);
$response = $this->owner->getResponse();
Expand Down
4 changes: 2 additions & 2 deletions code/pages/SubsitesVirtualPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function fieldLabels($includerelations = true)

public function getCopyContentFromID_SubsiteID()
{
return ($this->CopyContentFromID) ? (int)$this->CopyContentFrom()->SubsiteID : (int)Session::get('SubsiteID');
return $this->CopyContentFromID ? (int)$this->CopyContentFrom()->SubsiteID : (int)Session::get('SubsiteID');
}

public function getVirtualFields()
Expand Down Expand Up @@ -204,7 +204,7 @@ public function validURLSegment()
// Veto the validation rules if its false. In this case, some logic
// needs to be duplicated from parent to find out the exact reason the validation failed.
if (!$isValid) {
$IDFilter = ($this->ID) ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null;
$IDFilter = $this->ID ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null;
$parentFilter = null;

if (Config::inst()->get(SiteTree::class, 'nested_urls')) {
Expand Down

0 comments on commit 4fc13b1

Please sign in to comment.