| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public static function date($date, $format = null) |
||
| 39 | { |
||
| 40 | if (false === $date instanceof \DateTime) { |
||
| 41 | if ($format !== null) { |
||
| 42 | $date = \DateTime::createFromFormat($format, $date); |
||
| 43 | } else { |
||
| 44 | $date = new \DateTime($date); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | return $date->format(\DateTime::RFC2822); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |