diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php
index a92df095036f3..fda6ae9530135 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php
@@ -104,7 +104,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
* @param ImportProduct\StoreResolver $storeResolver
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
- * @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -193,6 +192,7 @@ protected function initTypeModels()
* Export process
*
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
public function export()
{
@@ -586,8 +586,8 @@ protected function getTierPrices(array $listSku, $table)
* Get Website code.
*
* @param int $websiteId
- *
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
*/
protected function _getWebsiteCode(int $websiteId): string
{
@@ -617,8 +617,9 @@ protected function _getWebsiteCode(int $websiteId): string
*
* @param int $groupId
* @param int $allGroups
- *
* @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function _getCustomerGroupById(
int $groupId,
diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php
index 4663aea7a7dfc..2e17e734b1e60 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php
@@ -8,7 +8,6 @@
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
-use Magento\Framework\App\ResourceConnection;
/**
* Class AdvancedPricing
@@ -618,6 +617,7 @@ protected function processCountNewPrices(array $tierPrices)
* Get product entity link field
*
* @return string
+ * @throws \Exception
*/
private function getProductEntityLinkField()
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php
index 25a9fc244fe51..d939a3f7c392e 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php
@@ -28,6 +28,7 @@ public function __construct($validators = [])
*
* @param array $value
* @return bool
+ * @throws \Zend_Validate_Exception
*/
public function isValid($value)
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php
index 48b4c58918740..6b266c76c32f3 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php
@@ -151,10 +151,13 @@ protected function setUp()
]
);
$this->exportConfig = $this->createMock(\Magento\ImportExport\Model\Export\Config::class);
- $this->productFactory = $this->createPartialMock(\Magento\Catalog\Model\ResourceModel\ProductFactory::class, [
+ $this->productFactory = $this->createPartialMock(
+ \Magento\Catalog\Model\ResourceModel\ProductFactory::class,
+ [
'create',
'getTypeId',
- ]);
+ ]
+ );
$this->attrSetColFactory = $this->createPartialMock(
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory::class,
[
@@ -185,11 +188,14 @@ protected function setUp()
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver::class
);
$this->groupRepository = $this->createMock(\Magento\Customer\Api\GroupRepositoryInterface::class);
- $this->writer = $this->createPartialMock(\Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class, [
- 'setHeaderCols',
- 'writeRow',
- 'getContents',
- ]);
+ $this->writer = $this->createPartialMock(
+ \Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class,
+ [
+ 'setHeaderCols',
+ 'writeRow',
+ 'getContents',
+ ]
+ );
$constructorMethods = [
'initTypeModels',
'initAttributes',
@@ -347,6 +353,7 @@ protected function tearDown()
* @param $object
* @param $property
* @return mixed
+ * @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
@@ -362,6 +369,8 @@ protected function getPropertyValue($object, $property)
* @param $object
* @param $property
* @param $value
+ * @return mixed
+ * @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php
index 7a81ccae6f0d0..2c930237da831 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php
@@ -346,6 +346,7 @@ public function isValidAddMessagesCallDataProvider()
* @param object $object
* @param string $property
* @return mixed
+ * @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
@@ -363,6 +364,7 @@ protected function getPropertyValue($object, $property)
* @param string $property
* @param mixed $value
* @return object
+ * @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php
index 08743b9fa7f2c..340e81746f029 100644
--- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php
+++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php
@@ -209,6 +209,10 @@ public function testGetEntityTypeCode()
* Test method validateRow against its result.
*
* @dataProvider validateRowResultDataProvider
+ * @param array $rowData
+ * @param string|null $behavior
+ * @param bool $expectedResult
+ * @throws \ReflectionException
*/
public function testValidateRowResult($rowData, $behavior, $expectedResult)
{
@@ -234,6 +238,10 @@ public function testValidateRowResult($rowData, $behavior, $expectedResult)
* Test method validateRow whether AddRowError is called.
*
* @dataProvider validateRowAddRowErrorCallDataProvider
+ * @param array $rowData
+ * @param string|null $behavior
+ * @param string $error
+ * @throws \ReflectionException
*/
public function testValidateRowAddRowErrorCall($rowData, $behavior, $error)
{
@@ -324,6 +332,13 @@ public function testSaveAdvancedPricing()
* Take into consideration different data and check relative internal calls.
*
* @dataProvider saveAndReplaceAdvancedPricesAppendBehaviourDataProvider
+ * @param array $data
+ * @param string $tierCustomerGroupId
+ * @param string $groupCustomerGroupId
+ * @param string $tierWebsiteId
+ * @param string $groupWebsiteId
+ * @param array $expectedTierPrices
+ * @throws \ReflectionException
*/
public function testSaveAndReplaceAdvancedPricesAppendBehaviourDataAndCalls(
$data,
@@ -956,6 +971,7 @@ public function processCountExistingPricesDataProvider()
* @param $object
* @param $property
* @return mixed
+ * @throws \ReflectionException
*/
protected function getPropertyValue($object, $property)
{
@@ -972,6 +988,8 @@ protected function getPropertyValue($object, $property)
* @param $object
* @param $property
* @param $value
+ * @return mixed
+ * @throws \ReflectionException
*/
protected function setPropertyValue(&$object, $property, $value)
{
@@ -989,8 +1007,8 @@ protected function setPropertyValue(&$object, $property, $value)
* @param object $object
* @param string $method
* @param array $args
- *
- * @return mixed the method result.
+ * @return mixed
+ * @throws \ReflectionException
*/
private function invokeMethod($object, $method, $args = [])
{
@@ -1007,6 +1025,7 @@ private function invokeMethod($object, $method, $args = [])
* @param array $methods
*
* @return \PHPUnit_Framework_MockObject_MockObject
+ * @throws \ReflectionException
*/
private function getAdvancedPricingMock($methods = [])
{
diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php
index f5e05cbc3e212..17ecba545efad 100644
--- a/app/code/Magento/Bundle/Model/Product/Type.php
+++ b/app/code/Magento/Bundle/Model/Product/Type.php
@@ -534,12 +534,12 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
foreach ($selections as $selection) {
if ($selection->getProductId() == $optionProduct->getId()) {
- foreach ($options as &$option) {
- if ($option->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
+ foreach ($options as $quoteItemOption) {
+ if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
if ($optionUpdateFlag) {
- $option->setValue(intval($option->getValue()));
+ $quoteItemOption->setValue(intval($quoteItemOption->getValue()));
} else {
- $option->setValue($value);
+ $quoteItemOption->setValue($value);
}
}
}
diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php
index d582005f653ef..181211a0fc4a2 100644
--- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php
+++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php
@@ -105,9 +105,11 @@ public function getOption()
}
/**
+ * Retrieve formatted price
+ *
* @return string
*/
- public function getFormatedPrice()
+ public function getFormattedPrice()
{
if ($option = $this->getOption()) {
return $this->_formatPrice(
@@ -120,6 +122,17 @@ public function getFormatedPrice()
return '';
}
+ /**
+ * @return string
+ *
+ * @deprecated
+ * @see getFormattedPrice()
+ */
+ public function getFormatedPrice()
+ {
+ return $this->getFormattedPrice();
+ }
+
/**
* Return formated price
*
diff --git a/app/code/Magento/Catalog/Block/Product/View/Price.php b/app/code/Magento/Catalog/Block/Product/View/Price.php
index c38625247b533..37598dfb1a8da 100644
--- a/app/code/Magento/Catalog/Block/Product/View/Price.php
+++ b/app/code/Magento/Catalog/Block/Product/View/Price.php
@@ -9,6 +9,8 @@
*/
namespace Magento\Catalog\Block\Product\View;
+use Magento\Catalog\Model\Product;
+
class Price extends \Magento\Framework\View\Element\Template
{
/**
@@ -37,7 +39,8 @@ public function __construct(
*/
public function getPrice()
{
+ /** @var Product $product */
$product = $this->_coreRegistry->registry('product');
- return $product->getFormatedPrice();
+ return $product->getFormattedPrice();
}
}
diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php
index f514e5c68769e..90af9bee270bd 100644
--- a/app/code/Magento/Catalog/Model/Product.php
+++ b/app/code/Magento/Catalog/Model/Product.php
@@ -1124,11 +1124,24 @@ public function getTierPrice($qty = null)
/**
* Get formatted by currency product price
*
- * @return array || double
+ * @return array|double
+ */
+ public function getFormattedPrice()
+ {
+ return $this->getPriceModel()->getFormattedPrice($this);
+ }
+
+ /**
+ * Get formatted by currency product price
+ *
+ * @return array|double
+ *
+ * @deprecated
+ * @see getFormattedPrice()
*/
public function getFormatedPrice()
{
- return $this->getPriceModel()->getFormatedPrice($this);
+ return $this->getFormattedPrice();
}
/**
diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php
index 7eaedf77eb859..f6caa299d66d7 100644
--- a/app/code/Magento/Catalog/Model/Product/Type/Price.php
+++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php
@@ -474,14 +474,15 @@ public function getTierPriceCount($product)
*
* @param float $qty
* @param Product $product
+ *
* @return array|float
*/
- public function getFormatedTierPrice($qty, $product)
+ public function getFormattedTierPrice($qty, $product)
{
$price = $product->getTierPrice($qty);
if (is_array($price)) {
foreach (array_keys($price) as $index) {
- $price[$index]['formated_price'] = $this->priceCurrency->convertAndFormat(
+ $price[$index]['formatted_price'] = $this->priceCurrency->convertAndFormat(
$price[$index]['website_price']
);
}
@@ -492,15 +493,45 @@ public function getFormatedTierPrice($qty, $product)
return $price;
}
+ /**
+ * Get formatted by currency tier price
+ *
+ * @param float $qty
+ * @param Product $product
+ *
+ * @return array|float
+ *
+ * @deprecated
+ * @see getFormattedTierPrice()
+ */
+ public function getFormatedTierPrice($qty, $product)
+ {
+ return $this->getFormattedTierPrice($qty, $product);
+ }
+
+ /**
+ * Get formatted by currency product price
+ *
+ * @param Product $product
+ * @return array|float
+ */
+ public function getFormattedPrice($product)
+ {
+ return $this->priceCurrency->format($product->getFinalPrice());
+ }
+
/**
* Get formatted by currency product price
*
* @param Product $product
* @return array || float
+ *
+ * @deprecated
+ * @see getFormattedPrice()
*/
public function getFormatedPrice($product)
{
- return $this->priceCurrency->format($product->getFinalPrice());
+ return $this->getFormattedPrice($product);
}
/**
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml
index 0166d15e226c0..5ed2bd5f75c01 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml
@@ -34,6 +34,7 @@
+
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml
index 8e5583a6699b7..30c05c2ec689b 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml
@@ -13,7 +13,7 @@
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml
index edf4f68afded7..4ad7a95c91980 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/file.phtml
@@ -7,6 +7,7 @@
// @codingStandardsIgnoreFile
?>
+
getOption(); ?>
getFileInfo(); ?>
hasData() ? true : false; ?>
@@ -64,7 +65,7 @@ require(['prototype'], function(){
diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/text.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/text.phtml
index 14e485c6445e0..11fba22ea8139 100644
--- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/text.phtml
+++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/text.phtml
@@ -12,7 +12,7 @@
getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_FIELD): ?>
diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/date.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/date.phtml
index 3420512977aad..66895fa1eabf9 100644
--- a/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/date.phtml
+++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/date.phtml
@@ -7,6 +7,7 @@
// @codingStandardsIgnoreFile
?>
+
getOption() ?>
getId() ?>
getIsRequire()) ? ' required' : ''; ?>
@@ -15,7 +16,7 @@