Permission   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 44
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace JhUser\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use ZfcRbac\Permission\PermissionInterface;
7
8
/**
9
 * @ORM\Entity
10
 * @ORM\Table(name="permission")
11
 */
12
class Permission implements PermissionInterface
13
{
14
    /**
15
     * @var int|null
16
     *
17
     * @ORM\Id
18
     * @ORM\Column(type="integer")
19
     * @ORM\GeneratedValue(strategy="AUTO")
20
     */
21
    protected $id;
22
23
    /**
24
     * @var string|null
25
     *
26
     * @ORM\Column(type="string", length=128, unique=true)
27
     */
28
    protected $name;
29
30
    /**
31
     * Constructor
32
     */
33
    public function __construct($name)
34
    {
35
        $this->name = (string) $name;
36
    }
37
38
    /**
39
     * Get the permission identifier
40
     *
41
     * @return int
42
     */
43
    public function getId()
44
    {
45
        return $this->id;
46
    }
47
48
    /**
49
     * {@inheritDoc}
50
     */
51
    public function __toString()
52
    {
53
        return $this->name;
54
    }
55
}
56