Skip to content

Commit

Permalink
refactor; add strict type
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Charlie committed Sep 7, 2020
1 parent 43b4f64 commit 9fd5436
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ public function cacheKeyProvider(): array
*/
public function testGetCacheKeyInfo(
array $expected,
string $priceCurrency = null,
string $customerGroupId = null
?string $priceCurrency = null,
?int $customerGroupId = null
): void {
$storeMock = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
$storeMock = $this->getMockBuilder(StoreInterface::class)
->setMethods(['getCurrentCurrency'])
->getMockForAbstractClass();
$storeMock->expects($this->any())
Expand Down
9 changes: 4 additions & 5 deletions app/code/Magento/Tax/Pricing/Render/Adjustment.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ public function displayPriceExcludingTax()
*
* @return string
*/
public function getDataPriceType()
public function getDataPriceType(): string
{
if ($this->getData('price_type') && $this->getData('price_type') !== 'finalPrice') {
return 'base' . ucfirst($this->getData('price_type'));
}
return 'basePrice';
return $this->amountRender->getPriceType() === 'finalPrice'
? 'basePrice'
: 'base' . ucfirst($this->amountRender->getPriceType());
}
}

0 comments on commit 9fd5436

Please sign in to comment.