EnumWithIdAndName::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace JosKolenberg\Enum;
4
5
abstract class EnumWithIdAndName extends EnumWithId
6
{
7
    /**
8
     * The displayname for the instance.
9
     *
10
     * @var mixed
11
     */
12
    protected $name;
13
14
    /**
15
     * AbstractEnumWithIdAndName constructor.
16
     *
17
     * @param $id
18
     * @param $name
19
     */
20 2
    public function __construct($id, $name)
21
    {
22 2
        parent::__construct($id);
23 2
        $this->name = $name;
24 1
    }
25
26
    /**
27
     * Get the name attribute.
28
     *
29
     * @return mixed
30
     */
31 2
    public function getName()
32
    {
33 2
        return $this->name;
34
    }
35
}
36