Completed
Pull Request — master (#52)
by Jasper
04:02
created

AbstractRelation::shouldOmitIncluded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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