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