Completed
Push — master ( 6972d7...5fe147 )
by Jasper
05:44
created

AbstractRelation::dissociate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Swis\JsonApi\Client\Relations;
4
5
use Swis\JsonApi\Client\Traits\HasLinks;
6
use Swis\JsonApi\Client\Traits\HasMeta;
7
8
abstract class AbstractRelation
9
{
10
    use HasLinks, HasMeta;
11
12
    /**
13
     * @var \Swis\JsonApi\Client\Interfaces\DataInterface|null
14
     */
15
    protected $included;
16
17
    /**
18
     * @var bool
19
     */
20
    protected $omitIncluded = false;
21
22
    /**
23
     * @return $this
24
     */
25 20
    public function dissociate()
26
    {
27 20
        $this->included = null;
28
29 20
        return $this;
30
    }
31
32
    /**
33
     * @param bool $omitIncluded
34
     *
35
     * @return $this
36
     */
37
    public function setOmitIncluded(bool $omitIncluded)
38
    {
39
        $this->omitIncluded = $omitIncluded;
40
41
        return $this;
42
    }
43
44
    /**
45
     * @return bool
46
     */
47
    public function shouldOmitIncluded(): bool
48
    {
49
        return $this->omitIncluded;
50
    }
51
}
52