Passed
Push — master ( 3dcfa3...d61f32 )
by Simon
01:56
created

SolrCoreServiceExtension::coreIsActive()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
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 SilverStripe\Core\Extension;
14
use Solarium\QueryType\Server\CoreAdmin\Result\StatusResult;
15
16
/**
17
 * Class \Firesphere\SolrCompatibility\Extensions\SolrCoreServiceExtension
18
 *
19
 * Add the old coreIsActive method to the Service for backward compatibility
20
 *
21
 * @property SolrCoreServiceExtension $owner
22
 */
23
class SolrCoreServiceExtension extends Extension
24
{
25
    /**
26
     * Check the status of a core
27
     *
28
     * @param string $core
29
     * @return StatusResult|null
30
     * @deprecated backward compatibility stub
31
     */
32
    public function coreIsActive($core)
33
    {
34
        return $this->owner->coreStatus($core);
1 ignored issue
show
Bug introduced by
The method coreStatus() does not exist on Firesphere\SolrCompatibi...olrCoreServiceExtension. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        return $this->owner->/** @scrutinizer ignore-call */ coreStatus($core);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
    }
36
37
}
38