Conditions | 3 |
Paths | 5 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
46 | if ($date === null) { |
||
47 | return false; |
||
48 | } |
||
49 | $d = \DateTime::createFromFormat($format, $date); |
||
50 | |||
51 | return $d && $d->format($format) === $date; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Date to DateTime. |
||
56 | * |
||
57 | * @param mixed $date |
||
58 | * |
||
59 | * @return \DateTime |
||
60 | */ |
||
61 | public static function dateToDatetime($date): \DateTime |
||
62 | { |
||
63 | // DateTime |
||
64 | if ($date instanceof \DateTime) { |
||
65 | return $date; |
||
98 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.