Completed
Push — master ( 535b5e...300324 )
by Jasper
13s queued 13s
created

HasType::getType()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Swis\JsonApi\Client\Concerns;
4
5
trait HasType
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $type;
11
12
    /**
13
     * @return string
14
     */
15 235
    public function getType(): string
16
    {
17 235
        return $this->type;
18
    }
19
20
    /**
21
     * @param string $type
22
     *
23
     * @return $this
24
     */
25 215
    public function setType(string $type)
26
    {
27 215
        $this->type = $type;
28
29 215
        return $this;
30
    }
31
32
    /**
33
     * @return bool
34
     */
35 40
    public function hasType(): bool
36
    {
37 40
        return (bool)$this->type;
38
    }
39
}
40