Completed
Push — master ( 527079...b8d1ae )
by Jasper
15s
created

AbstractRelation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 37.5%

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 40
ccs 3
cts 8
cp 0.375
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldOmitIncluded() 0 3 1
A dissociate() 0 5 1
A setOmitIncluded() 0 5 1
1
<?php
2
3
namespace Swis\JsonApi\Client\Relations;
4
5
abstract class AbstractRelation
6
{
7
    /**
8
     * @var \Swis\JsonApi\Client\Interfaces\DataInterface|null
9
     */
10
    protected $included;
11
12
    /**
13
     * @var bool
14
     */
15
    protected $omitIncluded = false;
16
17
    /**
18
     * @return $this
19
     */
20 20
    public function dissociate()
21
    {
22 20
        $this->included = null;
23
24 20
        return $this;
25
    }
26
27
    /**
28
     * @param bool $omitIncluded
29
     *
30
     * @return $this
31
     */
32
    public function setOmitIncluded(bool $omitIncluded)
33
    {
34
        $this->omitIncluded = $omitIncluded;
35
36
        return $this;
37
    }
38
39
    /**
40
     * @return bool
41
     */
42
    public function shouldOmitIncluded(): bool
43
    {
44
        return $this->omitIncluded;
45
    }
46
}
47