Completed
Pull Request — master (#21)
by GBProd
02:19 queued 21s
created

ReindexHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 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
        self::$crossIndexClassname::reindex(
0 ignored issues
show
Bug introduced by
The method reindex cannot be called on self::$crossIndexClassname (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
30 1
            $client->getIndex($oldIndex),
31 1
            $client->getIndex($newIndex)
32
        );
33 1
    }
34
}
35