Passed
Pull Request — master (#45)
by Jasper
03:55
created

AbstractRelation::setOmitIncluded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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