Completed
Push — master ( 24b486...2b6901 )
by Jasper
14s queued 10s
created

HasType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A setType() 0 5 1
A hasType() 0 3 1
1
<?php
2
3
namespace Swis\JsonApi\Client\Traits;
4
5
trait HasType
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $type;
11
12
    /**
13
     * @param string $type
14
     *
15
     * @return $this
16
     */
17 200
    public function setType(string $type)
18
    {
19 200
        $this->type = $type;
20
21 200
        return $this;
22
    }
23
24
    /**
25
     * @return string
26
     */
27 215
    public function getType(): string
28
    {
29 215
        return $this->type;
30
    }
31
32
    /**
33
     * @return bool
34
     */
35 35
    public function hasType(): bool
36
    {
37 35
        return (bool)$this->type;
38
    }
39
}
40