33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
7+ declare (strict_types=1 );
8+
69namespace Magento \AdvancedPricingImportExport \Model \Import \AdvancedPricing \Validator ;
710
811use Magento \AdvancedPricingImportExport \Model \Import \AdvancedPricing ;
12+ use Magento \CatalogImportExport \Model \Import \Product ;
913use Magento \CatalogImportExport \Model \Import \Product \RowValidatorInterface ;
14+ use Magento \CatalogImportExport \Model \Import \Product \StoreResolver ;
15+ use Magento \CatalogImportExport \Model \Import \Product \Validator \AbstractImportValidator ;
16+ use Magento \CatalogImportExport \Model \Import \Product \Validator \AbstractPrice ;
17+ use Magento \Customer \Api \GroupRepositoryInterface ;
18+ use Magento \Framework \Api \SearchCriteriaBuilder ;
19+ use Magento \Framework \Exception \LocalizedException ;
1020
11- class TierPrice extends \ Magento \ CatalogImportExport \ Model \ Import \ Product \ Validator \ AbstractPrice
21+ class TierPrice extends AbstractPrice
1222{
1323 /**
14- * @var \Magento\CatalogImportExport\Model\Import\Product\ StoreResolver
24+ * @var StoreResolver
1525 */
1626 protected $ storeResolver ;
1727
@@ -27,21 +37,26 @@ class TierPrice extends \Magento\CatalogImportExport\Model\Import\Product\Valida
2737 ];
2838
2939 /**
30- * @param \Magento\Customer\Api\ GroupRepositoryInterface $groupRepository
31- * @param \Magento\Framework\Api\ SearchCriteriaBuilder $searchCriteriaBuilder
32- * @param \Magento\CatalogImportExport\Model\Import\Product\ StoreResolver $storeResolver
40+ * @param GroupRepositoryInterface $groupRepository
41+ * @param SearchCriteriaBuilder $searchCriteriaBuilder
42+ * @param StoreResolver $storeResolver
3343 */
3444 public function __construct (
35- \ Magento \ Customer \ Api \ GroupRepositoryInterface $ groupRepository ,
36- \ Magento \ Framework \ Api \ SearchCriteriaBuilder $ searchCriteriaBuilder ,
37- \ Magento \ CatalogImportExport \ Model \ Import \ Product \ StoreResolver $ storeResolver
45+ GroupRepositoryInterface $ groupRepository ,
46+ SearchCriteriaBuilder $ searchCriteriaBuilder ,
47+ StoreResolver $ storeResolver
3848 ) {
3949 $ this ->storeResolver = $ storeResolver ;
4050 parent ::__construct ($ groupRepository , $ searchCriteriaBuilder );
4151 }
4252
4353 /**
44- * {@inheritdoc}
54+ * Initialize method
55+ *
56+ * @param Product $context
57+ *
58+ * @return RowValidatorInterface|AbstractImportValidator|void
59+ * @throws LocalizedException
4560 */
4661 public function init ($ context )
4762 {
@@ -52,7 +67,10 @@ public function init($context)
5267 }
5368
5469 /**
70+ * Add decimal error
71+ *
5572 * @param string $attribute
73+ *
5674 * @return void
5775 */
5876 protected function addDecimalError ($ attribute )
@@ -83,12 +101,12 @@ public function getCustomerGroups()
83101 }
84102
85103 /**
86- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
87104 * Validation
88105 *
89106 * @param mixed $value
90107 * @return bool
91108 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
109+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
92110 */
93111 public function isValid ($ value )
94112 {
@@ -133,6 +151,7 @@ public function isValid($value)
133151 * Check if at list one value and length are valid
134152 *
135153 * @param array $value
154+ *
136155 * @return bool
137156 */
138157 protected function isValidValueAndLength (array $ value )
@@ -150,6 +169,7 @@ protected function isValidValueAndLength(array $value)
150169 * Check if value has empty columns
151170 *
152171 * @param array $value
172+ *
153173 * @return bool
154174 */
155175 protected function hasEmptyColumns (array $ value )
0 commit comments