EnumWithIdAndName   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 5
c 2
b 1
f 0
dl 0
loc 29
ccs 6
cts 6
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 3 1
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