Passed
Pull Request — master (#1)
by Simon
08:01
created

SearchVariant   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 3
c 4
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A has_extension() 0 3 1
A activate_state() 0 3 1
1
<?php
2
3
namespace SilverStripe\FullTextSearch\Search\Variants;
4
5
use Firesphere\SolrSearch\States\SiteState;
6
use ReflectionException;
7
8
/**
9
 * Class SearchVariant is a stub to reduce the impact of migration to a newer Solr implementation.
10
 *
11
 * This class actually does nothing but supply the same endpoint as the existing one
12
 *
13
 * @package SilverStripe\FullTextSearch\Search\Variants
14
 */
15
abstract class SearchVariant extends SiteState
16
{
17
    /**
18
     * Stub to supply a check for a class if it has an extension applied
19
     * @deprecated use {@link SiteState::hasExtension()}
20
     * @param string $class
21
     * @param string $extension
22
     * @return bool
23
     * @throws ReflectionException
24
     */
25
    public static function has_extension($class, $extension): bool
26
    {
27
        return parent::hasExtension($class, $extension);
28
    }
29
30
    /**
31
     * Invoke the WithState method through a stub
32
     * @deprecated use {@link SiteState::withState()}
33
     * @param $state
34
     * @throws ReflectionException
35
     */
36
    public static function activate_state($state): void
37
    {
38
        parent::withState($state);
39
    }
40
}
41