Completed
Pull Request — master (#42)
by Jasper
03:02
created

AbstractRelation::setType()   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
use Swis\JsonApi\Client\Interfaces\RelationInterface;
6
7
abstract class AbstractRelation implements RelationInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $type;
13
14
    /**
15
     * @var bool
16
     */
17
    protected $omitIncluded = false;
18
19
    /**
20
     * @param string $type
21
     *
22
     * @return $this
23
     */
24
    public function setType(string $type)
25
    {
26
        $this->type = $type;
27
28
        return $this;
29
    }
30
31
    /**
32
     * @return string
33
     */
34 45
    public function getType(): string
35
    {
36 45
        return $this->type;
37
    }
38
39
    /**
40
     * @param bool $omitIncluded
41
     *
42
     * @return $this
43
     */
44
    public function setOmitIncluded(bool $omitIncluded)
45
    {
46
        $this->omitIncluded = $omitIncluded;
47
48
        return $this;
49
    }
50
51
    /**
52
     * @return bool
53
     */
54
    public function shouldOmitIncluded(): bool
55
    {
56
        return $this->omitIncluded;
57
    }
58
}
59