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

HasId   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A setId() 0 5 1
A hasId() 0 3 1
1
<?php
2
3
namespace Swis\JsonApi\Client\Concerns;
4
5
trait HasId
6
{
7
    /**
8
     * @var string|null
9
     */
10
    protected $id;
11
12
    /**
13
     * @return string|null
14
     */
15 250
    public function getId(): ?string
16
    {
17 250
        return $this->id;
18
    }
19
20
    /**
21
     * @param string|null $id
22
     *
23
     * @return static
24
     */
25 290
    public function setId(?string $id)
26
    {
27 290
        $this->id = $id;
28
29 290
        return $this;
30
    }
31
32
    /**
33
     * @return bool
34
     */
35 170
    public function hasId(): bool
36
    {
37 170
        return isset($this->id);
38
    }
39
}
40