Completed
Pull Request — master (#45)
by Jasper
11:58
created

AbstractRelation::shouldOmitIncluded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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