Completed
Push — master ( 318ca6...97a34f )
by Jasper
22s queued 10s
created

AbstractRelation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 20%

Importance

Changes 0
Metric Value
wmc 4
eloc 9
dl 0
loc 50
ccs 2
cts 10
cp 0.2
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldOmitIncluded() 0 3 1
A getType() 0 3 1
A setOmitIncluded() 0 5 1
A setType() 0 5 1
1
<?php
2
3
namespace Swis\JsonApi\Client\Relations;
4
5
use Swis\JsonApi\Client\Interfaces\RelationInterface;
6
7
abstract class AbstractRelation implements RelationInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $type;
13
14
    /**
15
     * @var bool
16
     */
17
    protected $omitIncluded = false;
18
19
    /**
20
     * @param string $type
21
     *
22
     * @return $this
23
     */
24
    public function setType(string $type)
25
    {
26
        $this->type = $type;
27
28
        return $this;
29
    }
30
31
    /**
32
     * @return string
33
     */
34 45
    public function getType(): string
35
    {
36 45
        return $this->type;
37
    }
38
39
    /**
40
     * @param bool $omitIncluded
41
     *
42
     * @return $this
43
     */
44
    public function setOmitIncluded(bool $omitIncluded)
45
    {
46
        $this->omitIncluded = $omitIncluded;
47
48
        return $this;
49
    }
50
51
    /**
52
     * @return bool
53
     */
54
    public function shouldOmitIncluded(): bool
55
    {
56
        return $this->omitIncluded;
57
    }
58
}
59