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

SearchVariant::activate_state()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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