Skip to content

Commit 5c80068

Browse files
Merge branch 'MAGNIMEX-392-Stabilize-PR-1-static-fixes' into 'master'
Magnimex 392 stabilize pr 1 static fixes Static fixes See merge request !219
2 parents e91bc33 + e2f9ca0 commit 5c80068

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ protected function numericValidation($attrCode, $type)
9898
* @param array $attrParams
9999
* @param array $rowData
100100
* @return bool
101+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
102+
* @SuppressWarnings(PHPMD.NPathComplexity)
101103
*/
102104
public function isAttributeValid($attrCode, array $attrParams, array $rowData)
103105
{

app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/Media.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Media extends AbstractImportValidator implements RowValidatorInterface
1919
const ADDITIONAL_IMAGES_DELIMITER = ',';
2020

2121
/** @var array */
22-
protected $media_attributes = ['image', 'small_image', 'thumbnail'];
22+
protected $mediaAttributes = ['image', 'small_image', 'thumbnail'];
2323

2424
/**
2525
* {@inheritdoc}
@@ -77,13 +77,17 @@ protected function checkUrlExists($url)
7777
}
7878

7979
/**
80-
* {@inheritdoc}
80+
* Validate value
81+
*
82+
* @param array $value
83+
* @return bool
84+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8185
*/
8286
public function isValid($value)
8387
{
8488
$this->_clearMessages();
8589
$valid = true;
86-
foreach ($this->media_attributes as $attribute) {
90+
foreach ($this->mediaAttributes as $attribute) {
8791
if (isset($value[$attribute]) && strlen($value[$attribute])) {
8892
if (!$this->checkPath($value[$attribute]) && !$this->checkValidUrl($value[$attribute])) {
8993
$this->_addMessages(

app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/Quantity.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ public function isValid($value)
2525
{
2626
$this->_clearMessages();
2727
if (!empty($value['qty']) && (!is_numeric($value['qty']) || $value['qty'] < 0)) {
28-
$this->_addMessages([sprintf($this->context->retrieveMessageTemplate(self::ERROR_INVALID_ATTRIBUTE_TYPE), 'qty', 'decimal')]);
28+
$this->_addMessages(
29+
[
30+
sprintf(
31+
$this->context->retrieveMessageTemplate(self::ERROR_INVALID_ATTRIBUTE_TYPE),
32+
'qty',
33+
'decimal'
34+
)
35+
]
36+
);
2937
return false;
3038
}
3139
return true;

app/code/Magento/CustomerImportExport/Model/Import/Address.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ protected function _initCountryRegions()
386386
*
387387
* @abstract
388388
* @return boolean
389+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
389390
*/
390391
protected function _importData()
391392
{

app/code/Magento/CustomerImportExport/Model/Import/Customer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ protected function _prepareDataForUpdate(array $rowData)
400400
*
401401
* @return bool
402402
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
403+
* @SuppressWarnings(PHPMD.NPathComplexity)
403404
*/
404405
protected function _importData()
405406
{

app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/AbstractCustomerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public function checkUniqueKeyDataProvider()
172172
* @param array $rowData
173173
* @param array $errors
174174
* @param boolean $isValid
175+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
175176
*/
176177
public function testCheckUniqueKey(array $rowData, array $errors, $isValid = false)
177178
{

0 commit comments

Comments
 (0)