SolrReindexTest_TestHandler::triggerReindex()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 2
b 0
f 0
nc 1
nop 4
dl 0
loc 3
rs 10
1
<?php
2
3
namespace SilverStripe\FullTextSearch\Tests\SolrReindexTest;
4
5
use SilverStripe\FullTextSearch\Solr\Reindex\Handlers\SolrReindexBase;
6
use Psr\Log\LoggerInterface;
7
use SilverStripe\FullTextSearch\Solr\SolrIndex;
8
9
/**
10
 * Provides a wrapper for testing SolrReindexBase
11
 */
12
class SolrReindexTest_TestHandler extends SolrReindexBase
13
{
14
    public function processGroup(
15
        LoggerInterface $logger,
16
        SolrIndex $indexInstance,
17
        $state,
18
        $class,
19
        $groups,
20
        $group,
21
        $taskName
22
    ) {
23
        $indexName = $indexInstance->getIndexName();
24
        $stateName = json_encode($state);
25
        $logger->info("Called processGroup with {$indexName}, {$stateName}, {$class}, group {$group} of {$groups}");
26
    }
27
28
    public function triggerReindex(LoggerInterface $logger, $batchSize, $taskName, $classes = null)
29
    {
30
        $logger->info("Called triggerReindex");
31
    }
32
}
33