1 | <?php |
||
2 | /** |
||
3 | * Created by PhpStorm. |
||
4 | * User: siim |
||
5 | * Date: 21.01.19 |
||
6 | * Time: 8:42 |
||
7 | */ |
||
8 | |||
9 | namespace Sf4\Api\Entity\Traits; |
||
10 | |||
11 | use Doctrine\ORM\Mapping as ORM; |
||
12 | use Ramsey\Uuid\UuidInterface; |
||
13 | use Sf4\Api\Utils\Traits\CreateNewTokenTrait; |
||
14 | |||
15 | trait EntityIdTrait |
||
16 | { |
||
17 | |||
18 | use CreateNewTokenTrait; |
||
19 | |||
20 | /** |
||
21 | * The unique auto incremented primary key. |
||
22 | * |
||
23 | * @var int|null |
||
24 | * |
||
25 | * @ORM\Id |
||
26 | * @ORM\Column(type="integer", options={"unsigned": true}) |
||
27 | * @ORM\GeneratedValue |
||
28 | */ |
||
29 | private $id; |
||
30 | |||
31 | /** |
||
32 | * The internal primary identity key. |
||
33 | * |
||
34 | * @var UuidInterface |
||
35 | * |
||
36 | * @ORM\Column(type="uuid", unique=true) |
||
37 | */ |
||
38 | private $uuid; |
||
39 | |||
40 | public function getId(): ?int |
||
41 | { |
||
42 | return $this->id; |
||
43 | } |
||
44 | |||
45 | public function getUuid(): UuidInterface |
||
46 | { |
||
47 | return $this->uuid; |
||
48 | } |
||
49 | |||
50 | public function createUuid(): void |
||
51 | { |
||
52 | $this->uuid = $this->createNewToken(); |
||
0 ignored issues
–
show
|
|||
53 | } |
||
54 | } |
||
55 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..