From 4fc13b19f732e1dff2846f637a0bce46b77a7535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Werner=20M=2E=20Krau=C3=9F?= Date: Thu, 1 Jun 2017 14:53:25 +0200 Subject: [PATCH] fixing code analysis: removing unnecessary parenthesis --- code/extensions/LeftAndMainSubsites.php | 2 +- code/pages/SubsitesVirtualPage.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/extensions/LeftAndMainSubsites.php b/code/extensions/LeftAndMainSubsites.php index 84f2dc4..7eb5c05 100644 --- a/code/extensions/LeftAndMainSubsites.php +++ b/code/extensions/LeftAndMainSubsites.php @@ -345,7 +345,7 @@ class LeftAndMainSubsites extends Extension { $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(); diff --git a/code/pages/SubsitesVirtualPage.php b/code/pages/SubsitesVirtualPage.php index d1b7a3e..023dfb9 100644 --- a/code/pages/SubsitesVirtualPage.php +++ b/code/pages/SubsitesVirtualPage.php @@ -140,7 +140,7 @@ class SubsitesVirtualPage extends VirtualPage 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() @@ -204,7 +204,7 @@ class SubsitesVirtualPage extends VirtualPage // 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')) {