Skip to content

Commit 6cdfd68

Browse files
committed
MAGETWO-69559: Declaration of dependencies for indexers
- fix merge conflicts
1 parent 21596e9 commit 6cdfd68

File tree

13 files changed

+38
-119
lines changed

13 files changed

+38
-119
lines changed

app/code/Magento/Indexer/Console/Command/AbstractIndexerManageCommand.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
/**
1313
* An Abstract class for all Indexer related commands.
14-
* @since 2.0.0
1514
*/
1615
abstract class AbstractIndexerManageCommand extends AbstractIndexerCommand
1716
{
@@ -26,7 +25,6 @@ abstract class AbstractIndexerManageCommand extends AbstractIndexerCommand
2625
* @param InputInterface $input
2726
* @return IndexerInterface[]
2827
* @throws \InvalidArgumentException
29-
* @since 2.0.0
3028
*/
3129
protected function getIndexers(InputInterface $input)
3230
{
@@ -57,7 +55,6 @@ protected function getIndexers(InputInterface $input)
5755
* Get list of options and arguments for the command
5856
*
5957
* @return mixed
60-
* @since 2.0.0
6158
*/
6259
public function getInputList()
6360
{

app/code/Magento/Indexer/Console/Command/IndexerReindexCommand.php

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,33 @@
1818

1919
/**
2020
* Command to run indexers
21-
* @since 2.0.0
2221
*/
2322
class IndexerReindexCommand extends AbstractIndexerManageCommand
2423
{
2524
/**
2625
* @var array
27-
* @since 2.1.0
2826
*/
2927
private $sharedIndexesComplete = [];
3028

3129
/**
3230
* @var ConfigInterface
33-
* @since 2.1.0
3431
*/
3532
private $config;
3633

3734
/**
3835
* @var IndexerRegistry
39-
* @since 2.2.0
4036
*/
4137
private $indexerRegistry;
4238

4339
/**
4440
* @var DependencyInfoProvider|null
45-
* @since 2.2.0
4641
*/
4742
private $dependencyInfoProvider;
4843

4944
/**
5045
* @param ObjectManagerFactory $objectManagerFactory
5146
* @param IndexerRegistry|null $indexerRegistry
5247
* @param DependencyInfoProvider|null $dependencyInfoProvider
53-
* @since 2.2.0
5448
*/
5549
public function __construct(
5650
ObjectManagerFactory $objectManagerFactory,
@@ -64,7 +58,6 @@ public function __construct(
6458

6559
/**
6660
* {@inheritdoc}
67-
* @since 2.0.0
6861
*/
6962
protected function configure()
7063
{
@@ -77,7 +70,6 @@ protected function configure()
7770

7871
/**
7972
* {@inheritdoc}
80-
* @since 2.0.0
8173
*/
8274
protected function execute(InputInterface $input, OutputInterface $output)
8375
{
@@ -113,7 +105,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
113105

114106
/**
115107
* {@inheritdoc} Returns the ordered list of specified indexers and related indexers.
116-
* @since 2.2.0
117108
*/
118109
protected function getIndexers(InputInterface $input)
119110
{
@@ -162,7 +153,6 @@ protected function getIndexers(InputInterface $input)
162153
*
163154
* @param string $indexerId
164155
* @return array
165-
* @since 2.2.0
166156
*/
167157
private function getRelatedIndexerIds(string $indexerId)
168158
{
@@ -183,7 +173,6 @@ private function getRelatedIndexerIds(string $indexerId)
183173
*
184174
* @param string $indexerId
185175
* @return array
186-
* @since 2.2.0
187176
*/
188177
private function getDependentIndexerIds(string $indexerId)
189178
{
@@ -208,7 +197,6 @@ private function getDependentIndexerIds(string $indexerId)
208197
* @param IndexerInterface $indexer
209198
* @return void
210199
* @throws LocalizedException
211-
* @since 2.1.0
212200
*/
213201
private function validateIndexerStatus(IndexerInterface $indexer)
214202
{
@@ -227,7 +215,6 @@ private function validateIndexerStatus(IndexerInterface $indexer)
227215
*
228216
* @param string $sharedIndex
229217
* @return array
230-
* @since 2.1.0
231218
*/
232219
private function getIndexerIdsBySharedIndex($sharedIndex)
233220
{
@@ -246,7 +233,6 @@ private function getIndexerIdsBySharedIndex($sharedIndex)
246233
*
247234
* @param string $sharedIndex
248235
* @return $this
249-
* @since 2.1.0
250236
*/
251237
private function validateSharedIndex($sharedIndex)
252238
{
@@ -272,8 +258,7 @@ private function validateSharedIndex($sharedIndex)
272258
* Get config
273259
*
274260
* @return ConfigInterface
275-
* @deprecated 2.1.0
276-
* @since 2.1.0
261+
* @deprecated 100.1.0
277262
*/
278263
private function getConfig()
279264
{
@@ -284,11 +269,8 @@ private function getConfig()
284269
}
285270

286271
/**
287-
* Get indexer registry.
288-
*
289272
* @return IndexerRegistry
290-
* @deprecated 2.2.0
291-
* @since 2.2.0
273+
* @deprecated 100.2.0
292274
*/
293275
private function getIndexerRegistry()
294276
{
@@ -300,8 +282,7 @@ private function getIndexerRegistry()
300282

301283
/**
302284
* @return DependencyInfoProvider
303-
* @deprecated 2.2.0
304-
* @since 2.2.0
285+
* @deprecated 100.2.0
305286
*/
306287
private function getDependencyInfoProvider()
307288
{

app/code/Magento/Indexer/Model/Processor.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@
1313
/**
1414
* Class \Magento\Indexer\Model\Processor
1515
*
16-
* @since 2.0.0
1716
*/
1817
class Processor
1918
{
2019
/**
2120
* @var ConfigInterface
22-
* @since 2.0.0
2321
*/
2422
protected $config;
2523

2624
/**
2725
* @var IndexerInterfaceFactory
28-
* @since 2.0.0
2926
*/
3027
protected $indexerFactory;
3128

3229
/**
3330
* @var Indexer\CollectionFactory
34-
* @since 2.0.0
3531
*/
3632
protected $indexersFactory;
3733

3834
/**
3935
* @var \Magento\Framework\Mview\ProcessorInterface
40-
* @since 2.0.0
4136
*/
4237
protected $mviewProcessor;
4338

@@ -46,7 +41,6 @@ class Processor
4641
* @param IndexerInterfaceFactory $indexerFactory
4742
* @param Indexer\CollectionFactory $indexersFactory
4843
* @param \Magento\Framework\Mview\ProcessorInterface $mviewProcessor
49-
* @since 2.0.0
5044
*/
5145
public function __construct(
5246
ConfigInterface $config,
@@ -64,7 +58,6 @@ public function __construct(
6458
* Regenerate indexes for all invalid indexers
6559
*
6660
* @return void
67-
* @since 2.0.0
6861
*/
6962
public function reindexAllInvalid()
7063
{
@@ -95,7 +88,6 @@ public function reindexAllInvalid()
9588
* Regenerate indexes for all indexers
9689
*
9790
* @return void
98-
* @since 2.0.0
9991
*/
10092
public function reindexAll()
10193
{
@@ -110,7 +102,6 @@ public function reindexAll()
110102
* Update indexer views
111103
*
112104
* @return void
113-
* @since 2.0.0
114105
*/
115106
public function updateMview()
116107
{
@@ -121,7 +112,6 @@ public function updateMview()
121112
* Clean indexer view changelogs
122113
*
123114
* @return void
124-
* @since 2.0.0
125115
*/
126116
public function clearChangelog()
127117
{

app/code/Magento/Indexer/Setup/RecurringData.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,16 @@
1414

1515
/**
1616
* Recurring data upgrade for indexer module
17-
* @since 2.2.0
1817
*/
1918
class RecurringData implements InstallDataInterface
2019
{
2120
/**
2221
* @var IndexerInterfaceFactory
23-
* @since 2.2.0
2422
*/
2523
private $indexerFactory;
2624

2725
/**
2826
* @var ConfigInterface
29-
* @since 2.2.0
3027
*/
3128
private $configInterface;
3229

@@ -35,7 +32,6 @@ class RecurringData implements InstallDataInterface
3532
*
3633
* @param IndexerInterfaceFactory $indexerFactory
3734
* @param ConfigInterface $configInterface
38-
* @since 2.2.0
3935
*/
4036
public function __construct(
4137
IndexerInterfaceFactory $indexerFactory,
@@ -47,7 +43,6 @@ public function __construct(
4743

4844
/**
4945
* {@inheritdoc}
50-
* @since 2.2.0
5146
*/
5247
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
5348
{

app/code/Magento/Indexer/Test/Unit/Console/Command/AbstractIndexerCommandCommonSetup.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
use Magento\Framework\Indexer\IndexerInterface;
1010
use Magento\Indexer\Model\Indexer\Collection;
1111

12-
/**
13-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
14-
*/
15-
class AbstractIndexerCommandCommonSetup extends \PHPUnit_Framework_TestCase
12+
class AbstractIndexerCommandCommonSetup extends \PHPUnit\Framework\TestCase
1613
{
1714
/**
1815
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\ObjectManager\ConfigLoader
@@ -51,24 +48,12 @@ class AbstractIndexerCommandCommonSetup extends \PHPUnit_Framework_TestCase
5148

5249
protected function setUp()
5350
{
54-
$this->objectManagerFactory = $this->getMock(
55-
\Magento\Framework\App\ObjectManagerFactory::class,
56-
[],
57-
[],
58-
'',
59-
false
60-
);
51+
$this->objectManagerFactory = $this->createMock(\Magento\Framework\App\ObjectManagerFactory::class);
6152
$this->objectManager = $this->getMockForAbstractClass(\Magento\Framework\ObjectManagerInterface::class);
6253
$this->objectManagerFactory->expects($this->any())->method('create')->willReturn($this->objectManager);
6354

64-
$this->stateMock = $this->getMock(\Magento\Framework\App\State::class, [], [], '', false);
65-
$this->configLoaderMock = $this->getMock(
66-
\Magento\Framework\App\ObjectManager\ConfigLoader::class,
67-
[],
68-
[],
69-
'',
70-
false
71-
);
55+
$this->stateMock = $this->createMock(\Magento\Framework\App\State::class);
56+
$this->configLoaderMock = $this->createMock(\Magento\Framework\App\ObjectManager\ConfigLoader::class);
7257

7358
$this->collectionFactory = $this->getMockBuilder(\Magento\Indexer\Model\Indexer\CollectionFactory::class)
7459
->disableOriginalConstructor()

app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerReindexCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class IndexerReindexCommandTest extends AbstractIndexerCommandCommonSetup
5454
public function setUp()
5555
{
5656
$this->objectManagerHelper = new ObjectManagerHelper($this);
57-
$this->configMock = $this->getMock(\Magento\Indexer\Model\Config::class, [], [], '', false);
57+
$this->configMock = $this->createMock(\Magento\Indexer\Model\Config::class);
5858
$this->indexerRegistryMock = $this->getMockBuilder(IndexerRegistry::class)
5959
->disableOriginalConstructor()
6060
->getMock();
@@ -440,8 +440,8 @@ public function testExecuteWithExceptionInGetIndexers()
440440
$this->initIndexerCollectionByItems([$indexerOne]);
441441

442442
$indexerOne->expects($this->never())->method('getTitle');
443-
$this->setExpectedException(
444-
\InvalidArgumentException::class,
443+
$this->expectException(\InvalidArgumentException::class);
444+
$this->expectExceptionMessage(
445445
"The following requested index types are not supported: '"
446446
. join("', '", $inputIndexers)
447447
. "'." . PHP_EOL . 'Supported types: '

app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerResetStateCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testExecute()
3333
);
3434
$this->initIndexerCollectionByItems([$indexerOne]);
3535

36-
$stateMock = $this->getMock(\Magento\Indexer\Model\Indexer\State::class, [], [], '', false);
36+
$stateMock = $this->createMock(\Magento\Indexer\Model\Indexer\State::class);
3737
$stateMock->expects($this->exactly(1))
3838
->method('setStatus')
3939
->with(\Magento\Framework\Indexer\StateInterface::STATUS_INVALID)

app/code/Magento/Indexer/Test/Unit/Model/Indexer/CollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\Indexer\Model\ResourceModel\Indexer\State\Collection as StateCollection;
1515
use Magento\Indexer\Model\ResourceModel\Indexer\State\CollectionFactory;
1616

17-
class CollectionTest extends \PHPUnit_Framework_TestCase
17+
class CollectionTest extends \PHPUnit\Framework\TestCase
1818
{
1919
/**
2020
* @var ObjectManagerHelper

0 commit comments

Comments
 (0)