Conditions | 6 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function isValid($input = null) |
||
25 | { |
||
26 | if ($input === null || $input === '' || $input instanceof PhpDateTime) { |
||
27 | return false; |
||
28 | } |
||
29 | |||
30 | $input = (string) $input; |
||
31 | |||
32 | if (!preg_match(static::PATTERN, $input, $matches)) { |
||
33 | $this->violations[] = 'format'; |
||
34 | |||
35 | return false; |
||
36 | } |
||
37 | |||
38 | if (!self::checkTime($matches[1], $matches[2], $matches[3])) { |
||
39 | $this->violations[] = 'time'; |
||
40 | |||
41 | return false; |
||
42 | } |
||
43 | |||
44 | return true; |
||
45 | } |
||
61 |