Conditions | 6 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function Format($format) { |
||
12 | if($this->value){ |
||
13 | $date = new DateTime($this->value); |
||
14 | //if the current user has set a timezone that is not the default then use that |
||
15 | $member = Member::currentUser(); |
||
16 | if ($member && $member->exists() && $member->Timezone && $member->Timezone != date_default_timezone_get()) { |
||
17 | $date->setTimezone(new DateTimeZone($member->Timezone)); |
||
18 | } |
||
19 | return $date->Format($format); |
||
20 | } |
||
21 | } |
||
22 | } |
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.