IndexerProcessor::process()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * File: IndexerProcessor.php
7
 *
8
 * @author Bartosz Kubicki [email protected]>
9
 * @author Paweł Papke <[email protected]>
10
 * @copyright Copyright (C) 2018 Lizard Media (http://lizardmedia.pl)
11
 */
12
13
namespace LizardMedia\AdminIndexer\Model;
14
15
use LizardMedia\AdminIndexer\Api\IndexerProcessorInterface;
16
use LizardMedia\AdminIndexer\Api\ReindexRunnerInterface;
17
use LizardMedia\AdminIndexer\Exception\ReindexFailureAggregateException;
18
19
/**
20
 * Class IndexerProcessor
21
 * @package LizardMedia\AdminIndexer\Model
22
 */
23
class IndexerProcessor implements IndexerProcessorInterface
24
{
25
    /**
26
     * @var ReindexRunnerInterface
27
     */
28
    private $reindexRunner;
29
30
    /**
31
     * IndexerProcessor constructor.
32
     * @param ReindexRunnerInterface $reindexRunner
33
     */
34
    public function __construct(
35
        ReindexRunnerInterface $reindexRunner
36
    ) {
37
        $this->reindexRunner = $reindexRunner;
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43
    public function process(string ...$indexerIds): void
44
    {
45
        $this->reindexRunner->run(...$indexerIds);
46
    }
47
}
48