From 9fd54363ced22b9d627f0768cf1820d125468e80 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" Date: Mon, 7 Sep 2020 14:38:11 +0300 Subject: [PATCH] refactor; add strict type --- .../Unit/Block/Product/View/Type/ConfigurableTest.php | 6 +++--- app/code/Magento/Tax/Pricing/Render/Adjustment.php | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php index 9abcfc6efaee3..08279c55c5b30 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php @@ -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()) diff --git a/app/code/Magento/Tax/Pricing/Render/Adjustment.php b/app/code/Magento/Tax/Pricing/Render/Adjustment.php index ec451eb012878..0e5c619790a97 100644 --- a/app/code/Magento/Tax/Pricing/Render/Adjustment.php +++ b/app/code/Magento/Tax/Pricing/Render/Adjustment.php @@ -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()); } }