Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2.0625 |
Changes | 0 |
1 | <?php |
||
25 | 4 | public static function fromCriteriaParameter(int $criteria): BirthdayDistanceCriteria |
|
26 | { |
||
27 | 4 | if (!in_array($criteria, [self::CLOSEST_BIRTHDAY, self::FURTHEST_BIRTHDAY])) { |
|
28 | throw new \InvalidArgumentException('Criteria ' . $criteria . ' is invalid.'); |
||
29 | } |
||
30 | |||
31 | 4 | return new self($criteria); |
|
32 | } |
||
33 | |||
52 |