Skip to content

Commit 05273e3

Browse files
author
Aleksey Gorbulin
committed
Refactoring
- remove never used classes - use short names for classes instead of fully described names in Magento_SalesRule module
1 parent c307d25 commit 05273e3

File tree

15 files changed

+12
-29
lines changed

15 files changed

+12
-29
lines changed

app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
namespace Magento\SalesRule\Controller\Adminhtml\Promo\Quote;
88

9-
use Magento\Framework\App\ObjectManager;
109
use Magento\SalesRule\Model\CouponGenerator;
1110

1211
class Generate extends \Magento\SalesRule\Controller\Adminhtml\Promo\Quote

app/code/Magento/SalesRule/Model/CouponRepository.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Magento\Framework\Api\Search\FilterGroup;
1010
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
11-
use Magento\Framework\Api\SortOrder;
1211
use Magento\SalesRule\Model\ResourceModel\Coupon\Collection;
1312

1413
/**
@@ -197,13 +196,13 @@ public function deleteById($couponId)
197196
/**
198197
* Helper function that adds a FilterGroup to the collection.
199198
*
200-
* @param \Magento\Framework\Api\Search\FilterGroup $filterGroup
199+
* @param FilterGroup $filterGroup
201200
* @param Collection $collection
202201
* @deprecated 100.2.0
203202
* @return void
204203
*/
205204
protected function addFilterGroupToCollection(
206-
\Magento\Framework\Api\Search\FilterGroup $filterGroup,
205+
FilterGroup $filterGroup,
207206
Collection $collection
208207
) {
209208
$fields = [];

app/code/Magento/SalesRule/Model/Data/Rule.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
1717
* @codeCoverageIgnore
1818
*/
19-
class Rule extends \Magento\Framework\Api\AbstractExtensibleObject implements
20-
\Magento\SalesRule\Api\Data\RuleInterface
19+
class Rule extends \Magento\Framework\Api\AbstractExtensibleObject implements RuleInterface
2120
{
2221
const KEY_RULE_ID = 'rule_id';
2322
const KEY_NAME = 'name';

app/code/Magento/SalesRule/Model/Plugin/QuoteConfigProductAttributes.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\SalesRule\Model\Plugin;
77

8-
use Magento\Store\Model\StoreManagerInterface;
9-
use Magento\Customer\Model\Session;
108
use Magento\SalesRule\Model\ResourceModel\Rule as RuleResource;
119

1210
class QuoteConfigProductAttributes

app/code/Magento/SalesRule/Model/ResourceModel/ReadHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\SalesRule\Model\ResourceModel;
77

8-
use Magento\SalesRule\Model\ResourceModel\Rule;
98
use Magento\Framework\EntityManager\MetadataPool;
109
use Magento\Framework\EntityManager\Operation\AttributeInterface;
1110

app/code/Magento/SalesRule/Model/ResourceModel/SaveHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\SalesRule\Model\ResourceModel;
77

8-
use Magento\SalesRule\Model\ResourceModel\Rule;
98
use Magento\Framework\EntityManager\MetadataPool;
109
use Magento\Framework\EntityManager\Operation\AttributeInterface;
1110

app/code/Magento/SalesRule/Model/Rule/Action/Discount/CartFixed.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\SalesRule\Model\Rule\Action\Discount;
77

8-
use Magento\Framework\App\ObjectManager;
98
use Magento\Framework\Pricing\PriceCurrencyInterface;
109
use Magento\SalesRule\Model\DeltaPriceRound;
1110
use Magento\SalesRule\Model\Validator;

app/code/Magento/SalesRule/Model/Rule/Metadata/ValueProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\SalesRule\Model\Rule\Metadata;
77

8-
use Magento\SalesRule\Model\ResourceModel\Rule\Collection;
98
use Magento\SalesRule\Model\Rule;
109
use Magento\Store\Model\System\Store;
1110
use Magento\Customer\Api\GroupRepositoryInterface;

app/code/Magento/SalesRule/Model/RuleRepository.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Magento\Framework\Api\Search\FilterGroup;
99
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
1010
use Magento\Framework\Api\SearchCriteriaInterface;
11-
use Magento\Framework\Api\SortOrder;
1211
use Magento\SalesRule\Model\ResourceModel\Rule\Collection;
1312

1413
/**
@@ -183,13 +182,13 @@ public function deleteById($id)
183182
/**
184183
* Helper function that adds a FilterGroup to the collection.
185184
*
186-
* @param \Magento\Framework\Api\Search\FilterGroup $filterGroup
185+
* @param FilterGroup $filterGroup
187186
* @param Collection $collection
188187
* @deprecated 100.2.0
189188
* @return void
190189
*/
191190
protected function addFilterGroupToCollection(
192-
\Magento\Framework\Api\Search\FilterGroup $filterGroup,
191+
FilterGroup $filterGroup,
193192
Collection $collection
194193
) {
195194
$fields = [];

app/code/Magento/SalesRule/Setup/Patch/Data/ConvertSerializedDataToJson.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Magento\SalesRule\Setup\Patch\Data;
88

9-
use Magento\Framework\App\ResourceConnection;
109
use Magento\Framework\Setup\Patch\DataPatchInterface;
1110
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1211

app/code/Magento/SalesRule/Setup/Patch/Data/FillSalesRuleProductAttributeTable.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Magento\SalesRule\Setup\Patch\Data;
88

9-
use Magento\Framework\App\ResourceConnection;
109
use Magento\Framework\App\State;
1110
use Magento\Framework\Setup\Patch\DataPatchInterface;
1211
use Magento\Framework\Setup\Patch\PatchVersionInterface;

app/code/Magento/SalesRule/Setup/Patch/Data/PrepareRuleModelSerializedData.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\SalesRule\Setup\Patch\Data;
88

99
use Magento\Framework\Setup\ModuleDataSetupInterface;
10-
use Magento\Framework\App\ResourceConnection;
1110
use Magento\Framework\Setup\Patch\DataPatchInterface;
1211
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1312

@@ -18,16 +17,16 @@
1817
class PrepareRuleModelSerializedData implements DataPatchInterface, PatchVersionInterface
1918
{
2019
/**
21-
* @var \Magento\Framework\Setup\ModuleDataSetupInterface
20+
* @var ModuleDataSetupInterface
2221
*/
2322
private $moduleDataSetup;
2423

2524
/**
2625
* PatchInitial constructor.
27-
* @param \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
26+
* @param ModuleDataSetupInterface $moduleDataSetup
2827
*/
2928
public function __construct(
30-
\Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
29+
ModuleDataSetupInterface $moduleDataSetup
3130
) {
3231
$this->moduleDataSetup = $moduleDataSetup;
3332
}

app/code/Magento/SalesRule/Test/Unit/Block/Adminhtml/Promo/Quote/Edit/DeleteButtonTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\SalesRule\Test\Unit\Block\Adminhtml\Promo\Quote\Edit;
77

8-
use Magento\SalesRule\Model\RegistryConstants;
98
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
109

1110
class DeleteButtonTest extends \PHPUnit\Framework\TestCase

app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/ReadHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class ReadHandlerTest extends \PHPUnit\Framework\TestCase
1717
{
1818
/**
19-
* @var \Magento\SalesRule\Model\ResourceModel\ReadHandler
19+
* @var ReadHandler
2020
*/
2121
protected $model;
2222

@@ -49,7 +49,7 @@ protected function setUp()
4949
$this->metadataPool = $this->createMock($className);
5050

5151
$this->model = $this->objectManager->getObject(
52-
\Magento\SalesRule\Model\ResourceModel\ReadHandler::class,
52+
ReadHandler::class,
5353
[
5454
'ruleResource' => $this->ruleResource,
5555
'metadataPool' => $this->metadataPool,

app/code/Magento/SalesRule/Test/Unit/Model/ResourceModel/Rule/DateApplierTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class DateApplierTest extends \PHPUnit\Framework\TestCase
1414
{
1515
/**
16-
* @var \Magento\SalesRule\Model\ResourceModel\Rule\DateApplier|\PHPUnit_Framework_MockObject_MockObject
16+
* @var DateApplier|\PHPUnit_Framework_MockObject_MockObject
1717
*/
1818
protected $model;
1919

@@ -29,10 +29,7 @@ protected function setUp()
2929
{
3030
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
3131

32-
$this->model = $this->objectManager->getObject(
33-
\Magento\SalesRule\Model\ResourceModel\Rule\DateApplier::class,
34-
[]
35-
);
32+
$this->model = $this->objectManager->getObject(DateApplier::class, []);
3633
}
3734

3835
/**

0 commit comments

Comments
 (0)