Passed
Pull Request — main (#8)
by Alex
03:11 queued 01:35
created

Gender   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 20
rs 10
ccs 7
cts 7
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A value() 0 3 1
A valueNotValidMessage() 0 3 1
A allowedValues() 0 5 1
1
<?php
2
3
namespace StraTDeS\VO\Single;
4
5
class Gender extends Enum
6
{
7
    const MALE = 'MALE';
8
    const FEMALE = 'FEMALE';
9
10 1
    public function value(): string
11
    {
12 1
        return $this->value;
13
    }
14
15 1
    protected function valueNotValidMessage($value): string
16
    {
17 1
        return "$value is not a valid gender";
18
    }
19
20 6
    public function allowedValues(): array
21
    {
22
        return [
23 6
            self::MALE,
24 6
            self::FEMALE
25
        ];
26
    }
27
}
28