File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,13 +69,34 @@ static public function from($source)
6969 return self ::$ cache [$ source ];
7070 }
7171
72+ /**
73+ * The name of the timezone.
74+ *
75+ * Note: This variable is only used to provide information during debugging.
76+ *
77+ * @var string
78+ */
79+ private $ name ;
80+
7281 /**
7382 * Location of the timezone.
7483 *
7584 * @var TimeZoneLocation
7685 */
7786 private $ location ;
7887
88+ /**
89+ * Initializes the {@link $name} property.
90+ *
91+ * @param string $timezone
92+ */
93+ public function __construct ($ timezone )
94+ {
95+ parent ::__construct ($ timezone );
96+
97+ $ this ->name = $ this ->getName ();
98+ }
99+
79100 /**
80101 * Returns the {@link $location}, {@link $name} and {@link $offset} properties.
81102 *
@@ -96,7 +117,7 @@ public function __get($property)
96117
97118 case 'name ' :
98119
99- return $ this ->getName () ;
120+ return $ this ->name ;
100121
101122 case 'offset ' :
102123
@@ -127,6 +148,6 @@ public function __get($property)
127148 */
128149 public function __toString ()
129150 {
130- return $ this ->getName () ;
151+ return $ this ->name ;
131152 }
132153}
You can’t perform that action at this time.
0 commit comments