Passed
Push — master ( a4e085...b27371 )
by Simon
07:44 queued 05:54
created

SolrCoreServiceExtension::coreIsActive()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * class SolrCoreServiceExtension|Firesphere\SolrCompatibility\Extensions\SolrCoreServiceExtension add the old
4
 * active state check
5
 *
6
 * @package Firesphere\SolrCompatibility\Extensions
7
 * @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo
8
 * @copyright Copyright (c) 2018 - now() Firesphere & Sheepy
9
 */
10
11
namespace Firesphere\SolrCompatibility\Extensions;
12
13
use Firesphere\SolrSearch\Services\SolrCoreService;
14
use SilverStripe\Core\Extension;
15
use Solarium\QueryType\Server\CoreAdmin\Result\StatusResult;
16
17
/**
18
 * Class \Firesphere\SolrCompatibility\Extensions\SolrCoreServiceExtension
19
 *
20
 * Add the old coreIsActive method to the Service for backward compatibility
21
 *
22
 * @property SolrCoreServiceExtension|SolrCoreService $owner
23
 */
24
class SolrCoreServiceExtension extends Extension
25
{
26
    /**
27
     * Check the status of a core
28
     *
29
     * @param string $core
30
     * @return StatusResult|null
31
     * @deprecated backward compatibility stub
32
     */
33 1
    public function coreIsActive($core)
34
    {
35 1
        return $this->owner->coreStatus($core);
36
    }
37
}
38