AutoGenerateId   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
ccs 4
cts 4
cp 1
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 15
    public function getId(): Id
13
    {
14 15
        if ($this->id === null) {
15 5
            $this->id = new Uuid();
16
        }
17
18 15
        return $this->id;
19
    }
20
}
21