Unit   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 104
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getId() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A setShortcut() 0 6 1
A getShortcut() 0 4 1
A compose() 0 5 1
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Domain\Unit\Enitity\UnitInterface;
7
8
/**
9
 * Unit
10
 *
11
 * @ORM\Table(name="unit")
12
 * @ORM\Entity(repositoryClass="AppBundle\Repository\UnitRepository")
13
 */
14
class Unit implements UnitInterface
15
{
16
    /**
17
     * @var int
18
     *
19
     * @ORM\Column(name="id", type="integer")
20
     * @ORM\Id
21
     * @ORM\GeneratedValue(strategy="AUTO")
22
     */
23
    private $id;
24
25
    /**
26
     * @var string
27
     *
28
     * @ORM\Column(name="name", type="string", length=64)
29
     */
30
    private $name;
31
32
    /**
33
     * @var string
34
     *
35
     * @ORM\Column(name="shortcut", type="string", length=3)
36
     */
37
    private $shortcut;
38
39
    /**
40
     * Unit constructor.
41
     *
42
     * @param string $name
43
     * @param string $shortcut
44
     */
45
    public function __construct($name, $shortcut)
46
    {
47
        $this->name = $name;
48
        $this->shortcut = $shortcut;
49
    }
50
51
    /**
52
     * Get id
53
     *
54
     * @return integer 
55
     */
56
    public function getId()
57
    {
58
        return $this->id;
59
    }
60
61
    /**
62
     * Set name
63
     *
64
     * @param string $name
65
     * @return Unit
66
     */
67
    public function setName($name)
68
    {
69
        $this->name = $name;
70
71
        return $this;
72
    }
73
74
    /**
75
     * Get name
76
     *
77
     * @return string 
78
     */
79
    public function getName()
80
    {
81
        return $this->name;
82
    }
83
84
    /**
85
     * Set shortcut
86
     *
87
     * @param string $shortcut
88
     * @return Unit
89
     */
90
    public function setShortcut($shortcut)
91
    {
92
        $this->shortcut = $shortcut;
93
94
        return $this;
95
    }
96
97
    /**
98
     * Get shortcut
99
     *
100
     * @return string 
101
     */
102
    public function getShortcut()
103
    {
104
        return $this->shortcut;
105
    }
106
107
    /**
108
     * @param string $name
109
     * @param string $shortcut
110
     * @return void
111
     */
112
    public function compose($name, $shortcut)
113
    {
114
        $this->setName($name);
115
        $this->setShortcut($shortcut);
116
    }
117
}
118