HasId   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 getId() 0 3 1
A setId() 0 5 1
A hasId() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Swis\JsonApi\Client\Concerns;
6
7
trait HasId
8
{
9
    /**
10
     * @var string|null
11
     */
12
    protected $id;
13
14 248
    public function getId(): ?string
15
    {
16 248
        return $this->id;
17
    }
18
19
    /**
20
     * @return static
21
     */
22 436
    public function setId(?string $id)
23
    {
24 436
        $this->id = $id;
25
26 436
        return $this;
27
    }
28
29 180
    public function hasId(): bool
30
    {
31 180
        return isset($this->id);
32
    }
33
}
34