GetSetSearchResolverTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 28
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setIndex() 0 5 1
A getIndex() 0 3 1
1
<?php
2
/**
3
 * Trait GetSetSearchResolverTrait|Firesphere\SolrSearch\Traits\GetSetSearchResolverTrait Used to extract methods from
4
 * the {@link \Firesphere\SolrSearch\Helpers\FieldResolver} to make the code more readable
5
 *
6
 * @package Firesphere\Solr\Search
7
 * @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo
8
 * @copyright Copyright (c) 2018 - now() Firesphere & Sheepy
9
 */
10
11
namespace Firesphere\SolrSearch\Traits;
12
13
use Firesphere\SolrSearch\Indexes\BaseIndex;
14
15
/**
16
 * Setters and getters for the introspection.
17
 *
18
 * Setters and getters to help with introspection/resolving, it's fairly simple, but extracted
19
 * so it's cleaner to read the code
20
 *
21
 * @package Firesphere\Solr\Search
22
 */
23
trait GetSetSearchResolverTrait
24
{
25
    /**
26
     * @var BaseIndex Index to use
27
     */
28
    protected $index;
29
30
    /**
31
     * Get the current index
32
     *
33
     * @return BaseIndex
34
     */
35 1
    public function getIndex(): BaseIndex
36
    {
37 1
        return $this->index;
38
    }
39
40
    /**
41
     * Set the current index
42
     *
43
     * @param mixed $index
44
     * @return $this
45
     */
46 54
    public function setIndex($index)
47
    {
48 54
        $this->index = $index;
49
50 54
        return $this;
51
    }
52
}
53