| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.4746 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | 4 | public static function getDefaultParams(\DateTime $dateTime = null, $noTime = false, $useTimezone = false) |
|
| 8 | { |
||
| 9 | 4 | $params = array(); |
|
| 10 | |||
| 11 | 4 | if ($useTimezone) { |
|
| 12 | $timeZone = $dateTime->getTimezone()->getName(); |
||
|
|
|||
| 13 | $params['TZID'] = $timeZone; |
||
| 14 | } |
||
| 15 | |||
| 16 | 4 | if ($noTime) { |
|
| 17 | $params['VALUE'] = 'DATE'; |
||
| 18 | } |
||
| 19 | |||
| 20 | 4 | return $params; |
|
| 21 | } |
||
| 22 | |||
| 61 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: