Passed
Push — sheepy/introspection ( 69e16c...c6c7ca )
by Marco
05:28
created

DocumentFactoryTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 11
c 1
b 0
f 0
dl 0
loc 59
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setItems() 0 5 1
A setClass() 0 5 1
A getItems() 0 3 1
A getClass() 0 3 1
A getIntrospection() 0 3 1
1
<?php
2
3
4
namespace Firesphere\SolrSearch\Traits;
5
6
use Firesphere\SolrSearch\Factories\DocumentFactory;
7
use Firesphere\SolrSearch\Helpers\SearchIntrospection;
8
use SilverStripe\ORM\ArrayList;
9
use SilverStripe\ORM\DataList;
10
11
trait DocumentFactoryTrait
12
{
13
    /**
14
     * @var SearchIntrospection
15
     */
16
    protected $introspection;
17
    /**
18
     * @var null|ArrayList|DataList
19
     */
20
    protected $items;
21
    /**
22
     * @var string
23
     */
24
    protected $class;
25
26
    /**
27
     * @return string
28
     */
29
    public function getClass(): string
30
    {
31
        return $this->class;
32
    }
33
34
    /**
35
     * @param string $class
36
     * @return DocumentFactory
37
     */
38
    public function setClass(string $class): self
39
    {
40
        $this->class = $class;
41
42
        return $this;
43
    }
44
45
    /**
46
     * @return SearchIntrospection
47
     */
48
    public function getIntrospection(): SearchIntrospection
49
    {
50
        return $this->introspection;
51
    }
52
53
    /**
54
     * @return ArrayList|DataList|null
55
     */
56
    public function getItems()
57
    {
58
        return $this->items;
59
    }
60
61
    /**
62
     * @param ArrayList|DataList|null $items
63
     * @return DocumentFactory
64
     */
65
    public function setItems($items): self
66
    {
67
        $this->items = $items;
68
69
        return $this;
70
    }
71
}
72