From d4f631d18b7f621b9f34e90c87efa028ba6a81c6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 5 Aug 2023 23:35:20 +0300 Subject: [PATCH] 1.2.3: https://github.com/mage2pro/currency-format/issues/13 --- Plugin/Framework/Pricing/PriceCurrencyInterface.php | 9 ++++++++- composer.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Plugin/Framework/Pricing/PriceCurrencyInterface.php b/Plugin/Framework/Pricing/PriceCurrencyInterface.php index 5198aab..a0b8a81 100644 --- a/Plugin/Framework/Pricing/PriceCurrencyInterface.php +++ b/Plugin/Framework/Pricing/PriceCurrencyInterface.php @@ -18,12 +18,19 @@ final class PriceCurrencyInterface { * https://github.com/magento/magento2/blob/2.0.0/lib/internal/Magento/Framework/Pricing/PriceCurrencyInterface.php#L42-L58 * 4) @see \Magento\Directory\Model\PriceCurrency::format() * https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Directory/Model/PriceCurrency.php#L70-L82 + * 2023-08-05 + * «Dfe\CurrencyFormat\Plugin\Framework\Pricing\PriceCurrencyInterface::beforeFormat(): + * Argument #2 ($a) must be of type float, null given»: https://github.com/mage2pro/currency-format/issues/13 + * @used-by \Magento\Framework\Pricing\Render\Amount::formatCurrency(): + * return $this->priceCurrency->format($amount, $includeContainer, $precision); + * https://github.com/magento/magento2/blob/2.4.7-beta1/lib/internal/Magento/Framework/Pricing/Render/Amount.php#L214-L228 + * @param float|null $a * @param int|null $precision [optional] * @param null|string|bool|int|\Magento\Framework\App\ScopeInterface $scope [optional] * @param \Magento\Framework\Model\AbstractModel|string|null $currency [optional] */ function beforeFormat( - Sb $sb, float $a, bool $includeContainer = true, $precision = null, $scope = null, $currency = null + Sb $sb, $a, bool $includeContainer = true, $precision = null, $scope = null, $currency = null ):array { # 2015-12-31 https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Directory/Model/PriceCurrency.php#L80 $currencyModel = $sb->getCurrency($scope, $currency); /** @var Currency $currencyModel */ diff --git a/composer.json b/composer.json index 8af9fc5..8e2b12d 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/currency-format" - ,"version": "1.2.2" + ,"version": "1.2.3" ,"description": "The «Price Format» extension for Magento 2" ,"type": "magento2-module" ,"homepage": "https://mage2.pro/c/price-format"