Skip to content

Commit 9104cb5

Browse files
committed
Remove redundant method
1 parent b3d318d commit 9104cb5

File tree

3 files changed

+40
-34
lines changed

3 files changed

+40
-34
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/TierPrice.php

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator;
710

811
use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing;
912
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface;
13+
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
14+
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractPrice;
15+
use Magento\Customer\Api\GroupRepositoryInterface;
16+
use Magento\Framework\Api\SearchCriteriaBuilder;
1017

11-
class TierPrice extends \Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractPrice
18+
class TierPrice extends AbstractPrice
1219
{
1320
/**
14-
* @var \Magento\CatalogImportExport\Model\Import\Product\StoreResolver
21+
* @var StoreResolver
1522
*/
1623
protected $storeResolver;
1724

@@ -27,14 +34,14 @@ class TierPrice extends \Magento\CatalogImportExport\Model\Import\Product\Valida
2734
];
2835

2936
/**
30-
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
31-
* @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder
32-
* @param \Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver
37+
* @param GroupRepositoryInterface $groupRepository
38+
* @param SearchCriteriaBuilder $searchCriteriaBuilder
39+
* @param StoreResolver $storeResolver
3340
*/
3441
public function __construct(
35-
\Magento\Customer\Api\GroupRepositoryInterface $groupRepository,
36-
\Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
37-
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver
42+
GroupRepositoryInterface $groupRepository,
43+
SearchCriteriaBuilder $searchCriteriaBuilder,
44+
StoreResolver $storeResolver
3845
) {
3946
$this->storeResolver = $storeResolver;
4047
parent::__construct($groupRepository, $searchCriteriaBuilder);
@@ -53,6 +60,7 @@ public function init($context)
5360

5461
/**
5562
* @param string $attribute
63+
*
5664
* @return void
5765
*/
5866
protected function addDecimalError($attribute)
@@ -83,12 +91,12 @@ public function getCustomerGroups()
8391
}
8492

8593
/**
86-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
8794
* Validation
8895
*
8996
* @param mixed $value
9097
* @return bool
9198
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
99+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
92100
*/
93101
public function isValid($value)
94102
{
@@ -133,6 +141,7 @@ public function isValid($value)
133141
* Check if at list one value and length are valid
134142
*
135143
* @param array $value
144+
*
136145
* @return bool
137146
*/
138147
protected function isValidValueAndLength(array $value)
@@ -150,6 +159,7 @@ protected function isValidValueAndLength(array $value)
150159
* Check if value has empty columns
151160
*
152161
* @param array $value
162+
*
153163
* @return bool
154164
*/
155165
protected function hasEmptyColumns(array $value)

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/TierPriceType.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,24 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
declare(strict_types=1);
8+
79
namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator;
810

911
use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing;
1012
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface;
13+
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator;
1114

1215
/**
1316
* Class TierPriceType validates tier price type.
1417
*/
15-
class TierPriceType extends \Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator
18+
class TierPriceType extends AbstractImportValidator
1619
{
17-
/**
18-
* {@inheritdoc}
19-
*/
20-
public function init($context)
21-
{
22-
return parent::init($context);
23-
}
24-
2520
/**
2621
* Validate tier price type.
2722
*
2823
* @param array $value
24+
*
2925
* @return bool
3026
*/
3127
public function isValid($value)

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,47 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator;
710

811
use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing;
9-
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator;
1012
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface;
13+
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
14+
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator;
15+
use Magento\Store\Model\Website as WebsiteModel;
1116

1217
class Website extends AbstractImportValidator implements RowValidatorInterface
1318
{
1419
/**
15-
* @var \Magento\CatalogImportExport\Model\Import\Product\StoreResolver
20+
* @var StoreResolver
1621
*/
1722
protected $storeResolver;
1823

1924
/**
20-
* @var \Magento\Store\Model\Website
25+
* @var WebsiteModel
2126
*/
2227
protected $websiteModel;
2328

2429
/**
25-
* @param \Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver
26-
* @param \Magento\Store\Model\Website $websiteModel
30+
* @param StoreResolver $storeResolver
31+
* @param WebsiteModel $websiteModel
2732
*/
2833
public function __construct(
29-
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver,
30-
\Magento\Store\Model\Website $websiteModel
34+
StoreResolver $storeResolver,
35+
WebsiteModel $websiteModel
3136
) {
3237
$this->storeResolver = $storeResolver;
3338
$this->websiteModel = $websiteModel;
3439
}
3540

36-
/**
37-
* {@inheritdoc}
38-
*/
39-
public function init($context)
40-
{
41-
return parent::init($context);
42-
}
43-
4441
/**
4542
* Validate by website type
4643
*
4744
* @param array $value
4845
* @param string $websiteCode
46+
*
4947
* @return bool
5048
*/
5149
protected function isWebsiteValid($value, $websiteCode)
@@ -63,6 +61,7 @@ protected function isWebsiteValid($value, $websiteCode)
6361
* Validate value
6462
*
6563
* @param mixed $value
64+
*
6665
* @return bool
6766
*/
6867
public function isValid($value)
@@ -85,6 +84,7 @@ public function isValid($value)
8584
*/
8685
public function getAllWebsitesValue()
8786
{
88-
return AdvancedPricing::VALUE_ALL_WEBSITES . ' ['.$this->websiteModel->getBaseCurrency()->getCurrencyCode().']';
87+
return AdvancedPricing::VALUE_ALL_WEBSITES .
88+
' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']';
8989
}
9090
}

0 commit comments

Comments
 (0)