Skip to content

Commit afdd2b7

Browse files
authored
ENGCOM-6016: Remove useless parentheses #24867
2 parents 342c17f + bc4e3dd commit afdd2b7

File tree

7 files changed

+27
-14
lines changed

7 files changed

+27
-14
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Edit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Catalog\Controller\Adminhtml\Product;
89

910
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
1011

12+
/**
13+
* Edit product
14+
*/
1115
class Edit extends \Magento\Catalog\Controller\Adminhtml\Product implements HttpGetActionInterface
1216
{
1317
/**
@@ -51,7 +55,7 @@ public function execute()
5155
$productId = (int) $this->getRequest()->getParam('id');
5256
$product = $this->productBuilder->build($this->getRequest());
5357

54-
if (($productId && !$product->getEntityId())) {
58+
if ($productId && !$product->getEntityId()) {
5559
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
5660
$resultRedirect = $this->resultRedirectFactory->create();
5761
$this->messageManager->addErrorMessage(__('This product doesn\'t exist.'));

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC
726726

727727
// TODO: getAttributeModel() should not be used when MAGETWO-48284 is complete
728728
$childData = $this->arrayManager->get($configPath, $meta, []);
729-
if (($rules = $this->catalogEavValidationRules->build($this->getAttributeModel($attribute), $childData))) {
729+
if ($rules = $this->catalogEavValidationRules->build($this->getAttributeModel($attribute), $childData)) {
730730
$meta = $this->arrayManager->merge($configPath, $meta, ['validation' => $rules]);
731731
}
732732

app/code/Magento/NewRelicReporting/Model/Apm/Deployments.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use \Magento\Framework\HTTP\ZendClient;
99

10+
/**
11+
* Performs the request to make the deployment
12+
*/
1013
class Deployments
1114
{
1215
/**
@@ -88,7 +91,7 @@ public function setDeployment($description, $change = false, $user = false)
8891
return false;
8992
}
9093

91-
if (($response->getStatus() < 200 || $response->getStatus() > 210)) {
94+
if ($response->getStatus() < 200 || $response->getStatus() > 210) {
9295
$this->logger->warning('Deployment marker request did not send a 200 status code.');
9396
return false;
9497
}

app/code/Magento/Persistent/Observer/MakePersistentQuoteGuestObserver.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Persistent\Observer;
89

910
use Magento\Framework\Event\ObserverInterface;
1011

12+
/**
13+
* Make persistent quote to be guest
14+
*
15+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
16+
*/
1117
class MakePersistentQuoteGuestObserver implements ObserverInterface
1218
{
1319
/**
@@ -65,8 +71,8 @@ public function execute(\Magento\Framework\Event\Observer $observer)
6571
/** @var $action \Magento\Persistent\Controller\Index */
6672
$action = $observer->getEvent()->getControllerAction();
6773
if ($action instanceof \Magento\Persistent\Controller\Index) {
68-
if ((($this->_persistentSession->isPersistent() && !$this->_customerSession->isLoggedIn())
69-
|| $this->_persistentData->isShoppingCartPersist())
74+
if (($this->_persistentSession->isPersistent() && !$this->_customerSession->isLoggedIn())
75+
|| $this->_persistentData->isShoppingCartPersist()
7076
) {
7177
$this->quoteManager->setGuest(true);
7278
}

app/code/Magento/Ui/Component/Control/SplitButton.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Ui\Component\Control;
78

89
/**
@@ -22,7 +23,7 @@
2223
class SplitButton extends Button
2324
{
2425
/**
25-
* {@inheritdoc}
26+
* @inheritdoc
2627
*/
2728
protected function getTemplatePath()
2829
{
@@ -83,12 +84,12 @@ public function getButtonAttributesHtml()
8384
'style' => $this->getStyle(),
8485
];
8586

86-
if (($idHard = $this->getIdHard())) {
87+
if ($idHard = $this->getIdHard()) {
8788
$attributes['id'] = $idHard;
8889
}
8990

9091
//TODO perhaps we need to skip data-mage-init when disabled="disabled"
91-
if (($dataAttribute = $this->getDataAttribute())) {
92+
if ($dataAttribute = $this->getDataAttribute()) {
9293
$this->getDataAttributes($dataAttribute, $attributes);
9394
}
9495

@@ -112,7 +113,7 @@ public function getToggleAttributesHtml()
112113
$title = $this->getLabel();
113114
}
114115

115-
if (($currentClass = $this->getClass())) {
116+
if ($currentClass = $this->getClass()) {
116117
$classes[] = $currentClass;
117118
}
118119

@@ -201,12 +202,11 @@ public function hasSplit()
201202
{
202203
return $this->hasData('has_split') ? (bool)$this->getData('has_split') : true;
203204
}
204-
205205
/**
206206
* Add data attributes to $attributes array
207207
*
208208
* @param array $data
209-
* @param array &$attributes
209+
* @param array $attributes
210210
* @return void
211211
*/
212212
protected function getDataAttributes($data, &$attributes)

dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/TaxClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class TaxClass extends DataSource
5252
public function __construct(FixtureFactory $fixtureFactory, array $params, $data = [])
5353
{
5454
$this->params = $params;
55-
if ((!isset($data['dataset']) && !isset($data['tax_product_class']))) {
55+
if (!isset($data['dataset']) && !isset($data['tax_product_class'])) {
5656
$this->data = $data;
5757
return;
5858
}

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ private function createModulesConfig($request, $dryRun = false)
429429
$disable = $this->readListOfModules($all, $request, InstallCommand::INPUT_KEY_DISABLE_MODULES);
430430
$result = [];
431431
foreach ($all as $module) {
432-
if ((isset($currentModules[$module]) && !$currentModules[$module])) {
432+
if (isset($currentModules[$module]) && !$currentModules[$module]) {
433433
$result[$module] = 0;
434434
} else {
435435
$result[$module] = 1;
@@ -925,7 +925,7 @@ private function throwExceptionForNotWritablePaths(array $paths)
925925
*/
926926
private function handleDBSchemaData($setup, $type, array $request)
927927
{
928-
if (!(($type === 'schema') || ($type === 'data'))) {
928+
if (!($type === 'schema' || $type === 'data')) {
929929
throw new \Magento\Setup\Exception("Unsupported operation type $type is requested");
930930
}
931931
$resource = new \Magento\Framework\Module\ModuleResource($this->context);

0 commit comments

Comments
 (0)