| Conditions | 5 |
| Paths | 4 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 5.3906 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 51 | 4 | public static function getDateFormat($noTime = false, $useTimezone = false, $useUtc = false) |
|
| 52 | { |
||
| 53 | // Do not use UTC time (Z) if timezone support is enabled. |
||
| 54 | 4 | if ($useTimezone || !$useUtc) { |
|
| 55 | return $noTime ? 'Ymd' : 'Ymd\THis'; |
||
| 56 | } |
||
| 57 | |||
| 58 | 4 | return $noTime ? 'Ymd' : 'Ymd\THis\Z'; |
|
| 59 | } |
||
| 60 | } |
||
| 61 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: