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

UuidTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 37
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setId() 0 6 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