HasType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
c 0
b 0
f 0
dl 0
loc 25
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setType() 0 5 1
A getType() 0 3 1
A hasType() 0 3 1
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