for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class SS_Datetimezone
*
* Adds customisable timezones to the nice method on {@link SS_Datetime}.
*/
class SS_Datetimezone extends SS_Datetime {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
* Returns the date in the raw SQL-format specific to a given timezone passed from the Member class, e.g. “2006-01-18 16:32:04”
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
public function Format($format) {
if($this->value){
$date = new DateTime($this->value);
//if the current user has set a timezone that is not the default then use that
$member = Member::currentUser();
if ($member && $member->exists() && $member->Timezone && $member->Timezone != date_default_timezone_get()) {
$date->setTimezone(new DateTimeZone($member->Timezone));
}
return $date->Format($format);
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.