Completed
Push — master ( 535176...8d0ac1 )
by Lukáš
09:34
created

UuidAutogeneratedTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Fousky\Traits\Uuid;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Ramsey\Uuid\Uuid;
7
8
/**
9
 * @author Lukáš Brzák <[email protected]>
10
 */
11
trait UuidAutogeneratedTrait
12
{
13
    /**
14
     * @var Uuid|null
15
     *
16
     * @ORM\Id()
17
     * @ORM\GeneratedValue(strategy="CUSTOM")
18
     * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
19
     * @ORM\Column(name="id", type="uuid")
20
     */
21
    protected $id;
22
23
    public function getId(): ?Uuid
24
    {
25
        return $this->id;
26
    }
27
}
28