diff --git a/lib/timezone.php b/lib/timezone.php old mode 100644 new mode 100755 index c306a34..03a2923 --- a/lib/timezone.php +++ b/lib/timezone.php @@ -69,6 +69,15 @@ static public function from($source) return self::$cache[$source]; } + /** + * The name of the timezone. + * + * Note: This variable is only used to provide information during debugging. + * + * @var string + */ + private $name; + /** * Location of the timezone. * @@ -76,6 +85,18 @@ static public function from($source) */ private $location; + /** + * Initializes the {@link $name} property. + * + * @param string $timezone + */ + public function __construct($timezone) + { + parent::__construct($timezone); + + $this->name = $this->getName(); + } + /** * Returns the {@link $location}, {@link $name} and {@link $offset} properties. * @@ -96,7 +117,7 @@ public function __get($property) case 'name': - return $this->getName(); + return $this->name; case 'offset': @@ -127,6 +148,6 @@ public function __get($property) */ public function __toString() { - return $this->getName(); + return $this->name; } } \ No newline at end of file