fixing code analysis: removing unnecessary parenthesis

This commit is contained in:
Werner M. Krauß 2017-06-01 14:53:25 +02:00
parent e7ad086641
commit 4fc13b19f7
2 changed files with 3 additions and 3 deletions

View File

@ -345,7 +345,7 @@ class LeftAndMainSubsites extends Extension
{ {
$page = DataObject::get_by_id(SiteTree::class, $data['ID']); $page = DataObject::get_by_id(SiteTree::class, $data['ID']);
$subsite = DataObject::get_by_id('Subsite', $data['CopyToSubsiteID']); $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); $newPage = $page->duplicateToSubsite($subsite->ID, $includeChildren);
$response = $this->owner->getResponse(); $response = $this->owner->getResponse();

View File

@ -140,7 +140,7 @@ class SubsitesVirtualPage extends VirtualPage
public function getCopyContentFromID_SubsiteID() 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() public function getVirtualFields()
@ -204,7 +204,7 @@ class SubsitesVirtualPage extends VirtualPage
// Veto the validation rules if its false. In this case, some logic // 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. // needs to be duplicated from parent to find out the exact reason the validation failed.
if (!$isValid) { if (!$isValid) {
$IDFilter = ($this->ID) ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null; $IDFilter = $this->ID ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null;
$parentFilter = null; $parentFilter = null;
if (Config::inst()->get(SiteTree::class, 'nested_urls')) { if (Config::inst()->get(SiteTree::class, 'nested_urls')) {