Conditions | 6 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function Format($format) { |
||
18 | if($this->value){ |
||
19 | $date = new DateTime($this->value); |
||
20 | //if the current user has set a timezone that is not the default then use that |
||
21 | $member = $this->getCurrentCachedUser(); |
||
22 | if ($member && $member->exists() && $member->Timezone && $member->Timezone != date_default_timezone_get()) { |
||
23 | $date->setTimezone(new DateTimeZone($member->Timezone)); |
||
24 | } |
||
25 | return $date->Format($format); |
||
26 | } |
||
27 | } |
||
28 | |||
46 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.