Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public static function filter($value) : string |
||
24 | { |
||
25 | if (!is_string($value) || trim($value) === '') { |
||
26 | throw new FilterException('$value must be a non-empty string'); |
||
27 | } |
||
28 | |||
29 | if (preg_match(self::TIME_OF_DAY_REGEX, $value) === 0) { |
||
30 | throw new FilterException('$value must be in the correct format HH:MM:SS'); |
||
31 | } |
||
32 | |||
33 | return $value; |
||
34 | } |
||
36 |