Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public static function filter($attrValue) |
||
19 | { |
||
20 | if (preg_match('/^(?=\\d)(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/D', $attrValue, $m)) |
||
21 | { |
||
22 | $m += [0, 0, 0, 0]; |
||
23 | |||
24 | return intval($m[1]) * 3600 + intval($m[2]) * 60 + intval($m[3]); |
||
25 | } |
||
26 | |||
27 | return NumericFilter::filterUint($attrValue); |
||
28 | } |
||
29 | } |