Completed
Push — master ( 626d53...eda003 )
by Rafael
02:18
created

UuidTrait::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace Mero\Bundle\BaseBundle\Entity\Field;
3
4
trait UuidTrait
5
{
6
    /**
7
     * @var string Primary key UUID
8
     *
9
     * @ORM\Id
10
     * @ORM\Column(type="integer")
11
     * @ORM\GeneratedValue(strategy="UUID")
12
     */
13
    protected $id;
14
15
    /**
16
     * Return primary key UUID identifier.
17
     *
18
     * @return string Primary key UUID
19
     */
20
    public function getId()
21
    {
22
        return $this->id;
23
    }
24
25
    /**
26
     * Sets primary key UUID identifier.
27
     *
28
     * @param string $id Primary key UUID
29
     *
30
     * @return UuidTrait
0 ignored issues
show
Comprehensibility Bug introduced by
The return type UuidTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
31
     */
32
    public function setId($id)
33
    {
34
        $this->id = $id;
35
36
        return $this;
37
    }
38
39
40
}
41