HasType::setType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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