Skip to content

Commit 64f76d7

Browse files
ENGCOM-8242: Cleaned up duplicate variable assignments in the same line #30120
- Merge Pull Request #30120 from bgorski/magento2:duplicated-assignment-cleanup - Merged commits: 1. baea0a2 2. 4153286 3. 7f2a29f 4. 41b265e
2 parents ae30d5e + 41b265e commit 64f76d7

File tree

7 files changed

+28
-10
lines changed

7 files changed

+28
-10
lines changed

app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/CategoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function setUp(): void
9494
->setMethods(['getState', 'getProductCollection'])
9595
->getMock();
9696

97-
$this->fulltextCollection = $this->fulltextCollection = $this->getMockBuilder(
97+
$this->fulltextCollection = $this->getMockBuilder(
9898
Collection::class
9999
)
100100
->disableOriginalConstructor()

app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/DecimalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function setUp(): void
8484
->method('create')
8585
->willReturn($this->filterItem);
8686

87-
$this->fulltextCollection = $this->fulltextCollection = $this->getMockBuilder(
87+
$this->fulltextCollection = $this->getMockBuilder(
8888
Collection::class
8989
)
9090
->disableOriginalConstructor()

app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/PriceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function setUp(): void
9999
->method('getState')
100100
->willReturn($this->state);
101101

102-
$this->fulltextCollection = $this->fulltextCollection = $this->getMockBuilder(
102+
$this->fulltextCollection = $this->getMockBuilder(
103103
Collection::class
104104
)
105105
->disableOriginalConstructor()

app/code/Magento/Reports/Block/Adminhtml/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ protected function _getAllowedStoreIds()
209209
} elseif ($this->getRequest()->getParam('website')) {
210210
$storeIds = $this->_storeManager->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
211211
} elseif ($this->getRequest()->getParam('group')) {
212-
$storeIds = $storeIds = $this->_storeManager->getGroup(
212+
$storeIds = $this->_storeManager->getGroup(
213213
$this->getRequest()->getParam('group')
214214
)->getStoreIds();
215215
}

app/code/Magento/Sales/Model/Order/Payment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ public function refund($creditmemo)
742742
$this->formatPrice($baseAmountToRefund)
743743
);
744744
}
745-
$message = $message = $this->prependMessage($message);
745+
$message = $this->prependMessage($message);
746746
$message = $this->_appendTransactionToMessage($transaction, $message);
747747
$orderState = $this->getOrderStateResolver()->getStateForOrder($this->getOrder());
748748
$statuses = $this->getOrder()->getConfig()->getStateStatuses($orderState, false);

app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protected function calculateWithTaxInPrice(QuoteDetailsItemInterface $item, $qua
2121
$this->taxClassManagement->getTaxClassId($item->getTaxClassKey())
2222
);
2323
$rate = $this->calculationTool->getRate($taxRateRequest);
24-
$storeRate = $storeRate = $this->calculationTool->getStoreRate($taxRateRequest, $this->storeId);
24+
$storeRate = $this->calculationTool->getStoreRate($taxRateRequest, $this->storeId);
2525

2626
$discountTaxCompensationAmount = 0;
2727
$applyTaxAfterDiscount = $this->config->applyTaxAfterDiscount($this->storeId);

app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
class UnitBaseCalculator extends AbstractCalculator
1111
{
1212
/**
13-
* {@inheritdoc}
13+
* Determines the rounding operation type and rounds the amount
14+
*
15+
* @param float $amount
16+
* @param string $rate
17+
* @param bool $direction
18+
* @param string $type
19+
* @param bool $round
20+
* @param QuoteDetailsItemInterface $item
21+
* @return float|string
1422
*/
1523
protected function roundAmount(
1624
$amount,
@@ -31,15 +39,20 @@ protected function roundAmount(
3139
}
3240

3341
/**
34-
* {@inheritdoc}
42+
* Calculate tax details for quote item with tax in price with given quantity
43+
*
44+
* @param QuoteDetailsItemInterface $item
45+
* @param int $quantity
46+
* @param bool $round
47+
* @return \Magento\Tax\Api\Data\TaxDetailsItemInterface
3548
*/
3649
protected function calculateWithTaxInPrice(QuoteDetailsItemInterface $item, $quantity, $round = true)
3750
{
3851
$taxRateRequest = $this->getAddressRateRequest()->setProductClassId(
3952
$this->taxClassManagement->getTaxClassId($item->getTaxClassKey())
4053
);
4154
$rate = $this->calculationTool->getRate($taxRateRequest);
42-
$storeRate = $storeRate = $this->calculationTool->getStoreRate($taxRateRequest, $this->storeId);
55+
$storeRate = $this->calculationTool->getStoreRate($taxRateRequest, $this->storeId);
4356

4457
// Calculate $priceInclTax
4558
$applyTaxAfterDiscount = $this->config->applyTaxAfterDiscount($this->storeId);
@@ -104,7 +117,12 @@ protected function calculateWithTaxInPrice(QuoteDetailsItemInterface $item, $qua
104117
}
105118

106119
/**
107-
* {@inheritdoc}
120+
* Calculate tax details for quote item with tax not in price with given quantity
121+
*
122+
* @param QuoteDetailsItemInterface $item
123+
* @param int $quantity
124+
* @param bool $round
125+
* @return \Magento\Tax\Api\Data\TaxDetailsItemInterface
108126
*/
109127
protected function calculateWithTaxNotInPrice(QuoteDetailsItemInterface $item, $quantity, $round = true)
110128
{

0 commit comments

Comments
 (0)