Completed
Push — master ( 501145...c31d74 )
by GBProd
01:44
created

ReindexHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 1
1
<?php
2
3
namespace GBProd\ElasticaExtraBundle\Handler;
4
5
use Elastica\Client;
6
use Elastica\Tool\CrossIndex;
7
8
/**
9
 * Handler for reindex
10
 *
11
 * @author gbprod <[email protected]>
12
 */
13
class ReindexHandler
14
{
15
    /**
16
     * @var string
17
     */
18
    public static $crossIndexClassname = CrossIndex::class;
19
20
    /**
21
     * Reindex handler
22
     *
23
     * @param Client $client
24
     * @param string $oldIndex
25
     * @param string $newIndex
26
     */
27 1
    public function handle(Client $client, $oldIndex, $newIndex)
28
    {
29 1
        $classname = self::$crossIndexClassname;
30
31 1
        $classname::reindex(
32 1
            $client->getIndex($oldIndex),
33 1
            $client->getIndex($newIndex)
34 1
        );
35 1
    }
36
}
37