Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0116 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
95 | 1 | public function setGender(string $gender): void |
|
96 | { |
||
97 | $genders = [ |
||
98 | 1 | self::GENDER_OTHER, |
|
99 | 1 | self::GENDER_MALE, |
|
100 | 1 | self::GENDER_FEMALE, |
|
101 | ]; |
||
102 | 1 | if (! in_array($gender, $genders)) { |
|
103 | throw new \InvalidArgumentException('Argument $gender is not valid'); |
||
104 | } |
||
105 | |||
106 | 1 | $this->gender = $gender; |
|
107 | 1 | } |
|
125 |