Passed
Push — master ( b97c16...98e719 )
by Dawid
04:21
created

AutoGenerateId   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getId() 0 7 2
1
<?php declare(strict_types=1);
2
3
namespace Igni\Storage\Id;
4
5
use Igni\Storage\Id;
6
7
/**
8
 * @property Id $id
9
 */
10
trait AutoGenerateId
11
{
12 10
    public function getId(): Id
13
    {
14 10
        if ($this->id === null) {
15
            $this->id = new Uuid();
16
        }
17
18 10
        return $this->id;
19
    }
20
}
21