@@ -118,13 +118,13 @@ class IntlDateFormatter
118
118
private $ timeZoneId ;
119
119
120
120
/**
121
- * @param string $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")
122
- * @param int $datetype Type of date formatting, one of the format type constants
123
- * @param int $timetype Type of time formatting, one of the format type constants
124
- * @param mixed $timezone Timezone identifier
125
- * @param int $calendar Calendar to use for formatting or parsing. The only currently
126
- * supported value is IntlDateFormatter::GREGORIAN (or null using the default calendar, i.e. "GREGORIAN")
127
- * @param string $pattern Optional pattern to use when formatting
121
+ * @param string $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")
122
+ * @param int|null $datetype Type of date formatting, one of the format type constants
123
+ * @param int|null $timetype Type of time formatting, one of the format type constants
124
+ * @param \IntlTimeZone|\DateTimeZone|string|null $timezone Timezone identifier
125
+ * @param int $calendar Calendar to use for formatting or parsing. The only currently
126
+ * supported value is IntlDateFormatter::GREGORIAN (or null using the default calendar, i.e. "GREGORIAN")
127
+ * @param string|null $pattern Optional pattern to use when formatting
128
128
*
129
129
* @see http://www.php.net/manual/en/intldateformatter.create.php
130
130
* @see http://userguide.icu-project.org/formatparse/datetime
@@ -142,8 +142,8 @@ public function __construct($locale, $datetype, $timetype, $timezone = null, $ca
142
142
throw new MethodArgumentValueNotImplementedException (__METHOD__ , 'calendar ' , $ calendar , 'Only the GREGORIAN calendar is supported ' );
143
143
}
144
144
145
- $ this ->datetype = $ datetype ;
146
- $ this ->timetype = $ timetype ;
145
+ $ this ->datetype = null !== $ datetype ? $ datetype : self :: FULL ;
146
+ $ this ->timetype = null !== $ timetype ? $ timetype : self :: FULL ;
147
147
148
148
$ this ->setPattern ($ pattern );
149
149
$ this ->setTimeZone ($ timezone );
@@ -152,13 +152,13 @@ public function __construct($locale, $datetype, $timetype, $timezone = null, $ca
152
152
/**
153
153
* Static constructor.
154
154
*
155
- * @param string $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")
156
- * @param int $datetype Type of date formatting, one of the format type constants
157
- * @param int $timetype Type of time formatting, one of the format type constants
158
- * @param string $timezone Timezone identifier<
10000
/span>
159
- * @param int $calendar Calendar to use for formatting or parsing; default is Gregorian
160
- * One of the calendar constants
161
- * @param string $pattern Optional pattern to use when formatting
155
+ * @param string $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")
156
+ * @param int|null $datetype Type of date formatting, one of the format type constants
157
+ * @param int|null $timetype Type of time formatting, one of the format type constants
158
+ * @param \IntlTimeZone|\DateTimeZone| string|null $timezone Timezone identifier
159
+ * @param int $calendar Calendar to use for formatting or parsing; default is Gregorian
160
+ * One of the calendar constants
161
+ * @param string|null $pattern Optional pattern to use when formatting
162
162
*
163
163
* @return self
164
164
*
@@ -485,7 +485,7 @@ public function setLenient($lenient)
485
485
/**
486
486
* Set the formatter's pattern.
487
487
*
488
- * @param string $pattern A pattern string in conformance with the ICU IntlDateFormatter documentation
488
+ * @param string|null $pattern A pattern string in conformance with the ICU IntlDateFormatter documentation
489
489
*
490
490
* @return bool true on success or false on failure
491
491
*
@@ -506,9 +506,9 @@ public function setPattern($pattern)
506
506
/**
507
507
* Set the formatter's timezone identifier.
508
508
*
509
- * @param string $timeZoneId The time zone ID string of the time zone to use.
510
- * If NULL or the empty string, the default time zone for the
511
- * runtime is used.
509
+ * @param string|null $timeZoneId The time zone ID string of the time zone to use.
510
+ * If NULL or the empty string, the default time zone for the
511
+ * runtime is used.
512
512
*
513
513
* @return bool true on success or false on failure
514
514
*
@@ -552,7 +552,7 @@ public function setTimeZoneId($timeZoneId)
552
552
/**
553
553
* This method was added in PHP 5.5 as replacement for `setTimeZoneId()`.
554
554
*
555
- * @param mixed $timeZone
555
+ * @param \IntlTimeZone|\DateTimeZone|string|null $timeZone
556
556
*
557
557
* @return bool true on success or false on failure
558
558
*
0 commit comments