ソースを参照

Fix "use" statements and CS error.

ADmad 9 年 前
コミット
a76268afad
1 ファイル変更9 行追加9 行削除
  1. 9 9
      src/I18n/DateFormatTrait.php

+ 9 - 9
src/I18n/DateFormatTrait.php

@@ -16,10 +16,10 @@ namespace Cake\I18n;
 
 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 @@ trait DateFormatTrait
     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.');
         }
     }