Skip to content
Permalink
Browse files

Fix "use" statements and CS error.

  • Loading branch information...
ADmad committed Jun 4, 2016
1 parent 476d417 commit a76268afad8c5d96d162ac5d78a977f1344686a7
Showing with 9 additions and 9 deletions.
  1. +9 −9 src/I18n/DateFormatTrait.php
@@ -16,10 +16,10 @@
use Cake\Chronos\Date as ChronosDate;
use Cake\Chronos\MutableDate;
use DateTimeZone;
use IntlDateFormatter;
use \DateTimeZone;
use \InvalidArgumentException;
use \RuntimeException;
use InvalidArgumentException;
use RuntimeException;
/**
* Trait for date formatting methods shared by both Time & Date.
@@ -71,7 +71,7 @@ trait DateFormatTrait
/**
* Caches whether or not this class is a subclass of a Date or MutableDate
*
* @var boolean
* @var bool
*/
protected static $_isDateInstance;
@@ -84,7 +84,7 @@ trait DateFormatTrait
public static function getDefaultOutputTimezone()
{
if (is_subclass_of(static::class, ChronosDate::class) || is_subclass_of(static::class, MutableDate::class)) {
throw new \RuntimeException('Timezone conversion is not supported by Date/FrozenDate.');
throw new RuntimeException('Timezone conversion is not supported by Date/FrozenDate.');
}
return static::$_defaultOutputTimezone;
}
@@ -101,14 +101,14 @@ public static function getDefaultOutputTimezone()
public static function setDefaultOutputTimezone($timezone)
{
if (is_subclass_of(static::class, ChronosDate::class) || is_subclass_of(static::class, MutableDate::class)) {
throw new \RuntimeException('Timezone conversion is not supported by Date/FrozenDate.');
throw new RuntimeException('Timezone conversion is not supported by Date/FrozenDate.');
}
if (is_string($timezone)) {
static::$_defaultOutputTimezone = new \DateTimeZone($timezone);
} elseif ($timezone instanceof \DateTimeZone) {
static::$_defaultOutputTimezone = new DateTimeZone($timezone);
} elseif ($timezone instanceof DateTimeZone) {
static::$_defaultOutputTimezone = $timezone;
} else {
throw new \InvalidArgumentException('Expected valid DateTimeZone string or \DateTimeZone object.');
throw new InvalidArgumentException('Expected valid DateTimeZone string or \DateTimeZone object.');
}
}

0 comments on commit a76268a

Please sign in to comment.
You can’t perform that action at this time.