Skip to content

Commit 9fd5436

Browse files
refactor; add strict type
1 parent 43b4f64 commit 9fd5436

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ public function cacheKeyProvider(): array
256256
*/
257257
public function testGetCacheKeyInfo(
258258
array $expected,
259-
string $priceCurrency = null,
260-
string $customerGroupId = null
259+
?string $priceCurrency = null,
260+
?int $customerGroupId = null
261261
): void {
262-
$storeMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
262+
$storeMock = $this->getMockBuilder(StoreInterface::class)
263263
->setMethods(['getCurrentCurrency'])
264264
->getMockForAbstractClass();
265265
$storeMock->expects($this->any())

app/code/Magento/Tax/Pricing/Render/Adjustment.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ public function displayPriceExcludingTax()
181181
*
182182
* @return string
183183
*/
184-
public function getDataPriceType()
184+
public function getDataPriceType(): string
185185
{
186-
if ($this->getData('price_type') && $this->getData('price_type') !== 'finalPrice') {
187-
return 'base' . ucfirst($this->getData('price_type'));
188-
}
189-
return 'basePrice';
186+
return $this->amountRender->getPriceType() === 'finalPrice'
187+
? 'basePrice'
188+
: 'base' . ucfirst($this->amountRender->getPriceType());
190189
}
191190
}

0 commit comments

Comments
 (0)