Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 7 | public static function date($value, $format, $message = '') |
|
11 | { |
||
12 | 7 | $date = DateTime::createFromFormat($format, $value); |
|
13 | 7 | if ($date === false) { |
|
14 | 1 | static::reportInvalidArgument(sprintf( |
|
15 | 1 | $message ?: 'Expected a valid date in format %s. Got: %s', |
|
16 | 1 | $format, |
|
17 | 1 | $value |
|
18 | )); |
||
19 | } |
||
20 | 6 | } |
|
21 | } |
||
22 |