IndexerProcessor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 25
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A process() 0 4 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