Completed
Push — master ( 3a1449...d95c29 )
by Jean
02:46
created

ElasticSearchProcessorTrait::getProcessor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * @author Jean Silva <[email protected]>
4
 * @license MIT
5
 */
6
namespace Jeancsil\FlightSpy\History\ElasticSearch;
7
8
trait ElasticSearchProcessorTrait
9
{
10
    /**
11
     * @var Processor
12
     */
13
    protected $processor;
14
15
   /**
16
     * @return Processor
17
     */
18
    public function getProcessor()
19
    {
20
        if ($this->processor != null) {
21
            return $this->processor;
22
        }
23
24
        return new DummyProcessor();
25
    }
26
27
    /**
28
     * @param Processor $processor
29
     * @return $this
30
     */
31
    public function setProcessor(Processor $processor)
32
    {
33
        $this->processor = $processor;
34
35
        return $this;
36
    }
37
}
38