Skip to content

Commit a5966f4

Browse files
committed
Fix arginfo
1 parent 92951a6 commit a5966f4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

ext/intl/dateformat/dateformat.stub.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getPattern() {}
5454
/** @return string|false */
5555
public function getLocale(int $which = UNKNOWN) {}
5656

57-
/** @return null|bool */
57+
/** @return bool|null */
5858
public function setLenient(bool $lenient) {}
5959

6060
/** @return bool */
@@ -73,7 +73,7 @@ public function format($value) {}
7373
*/
7474
public static function formatObject($object, $format = null, ?string $locale = null) {}
7575

76-
/** @return int|false */
76+
/** @return int|float|false */
7777
public function parse(string $value, ?int &$position = null) {}
7878

7979
/** @return array|false */
@@ -103,11 +103,9 @@ function datefmt_set_calendar(IntlDateFormatter $df, $which): bool {}
103103

104104
function datefmt_get_timezone_id(IntlDateFormatter $df): string {}
105105

106-
/** @return IntlCalendar|null|false */
107-
function datefmt_get_calendar_object(IntlDateFormatter $df) {}
106+
function datefmt_get_calendar_object(IntlDateFormatter $df): IntlCalendar|false|null {}
108107

109-
/** @return IntlTimeZone|false */
110-
function datefmt_get_timezone(IntlDateFormatter $df) {}
108+
function datefmt_get_timezone(IntlDateFormatter $df): IntlTimeZone|false {}
111109

112110
/** @param IntlTimeZone|DateTimeZone|string|null $zone */
113111
function datefmt_set_timezone(IntlDateFormatter $df, $zone): ?bool {}
@@ -118,7 +116,7 @@ function datefmt_get_pattern(IntlDateFormatter $df): string|false {}
118116

119117
function datefmt_get_locale(IntlDateFormatter $df, int $which = UNKNOWN): string|false {}
120118

121-
function datefmt_set_lenient(IntlDateFormatter $df, bool $lenient): null|bool {}
119+
function datefmt_set_lenient(IntlDateFormatter $df, bool $lenient): ?bool {}
122120

123121
function datefmt_is_lenient(IntlDateFormatter $df): bool {}
124122

@@ -131,7 +129,7 @@ function datefmt_format(IntlDateFormatter $df, $value): string|false {}
131129
*/
132130
function datefmt_format_object($object, $format = null, ?string $locale = null): string|false {}
133131

134-
function datefmt_parse(IntlDateFormatter $df, string $value, ?int &$position = null): int|false {}
132+
function datefmt_parse(IntlDateFormatter $df, string $value, ?int &$position = null): int|float|false {}
135133

136134
function datefmt_localtime(IntlDateFormatter $df, string $value, ?int &$position = null): array|false {}
137135

ext/intl/dateformat/dateformat_arginfo.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datefmt_get_timezone_id, 0, 1, I
9595
ZEND_ARG_OBJ_INFO(0, df, IntlDateFormatter, 0)
9696
ZEND_END_ARG_INFO()
9797

98-
ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_get_calendar_object, 0, 0, 1)
98+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_datefmt_get_calendar_object, 0, 1, IntlCalendar, MAY_BE_FALSE|MAY_BE_NULL)
9999
ZEND_ARG_OBJ_INFO(0, df, IntlDateFormatter, 0)
100100
ZEND_END_ARG_INFO()
101101

102-
#define arginfo_datefmt_get_timezone arginfo_datefmt_get_calendar_object
102+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_datefmt_get_timezone, 0, 1, IntlTimeZone, MAY_BE_FALSE)
103+
ZEND_ARG_OBJ_INFO(0, df, IntlDateFormatter, 0)
104+
ZEND_END_ARG_INFO()
103105

104106
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datefmt_set_timezone, 0, 2, _IS_BOOL, 1)
105107
ZEND_ARG_OBJ_INFO(0, df, IntlDateFormatter, 0)
@@ -120,7 +122,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_get_locale, 0, 1, MAY_BE
120122
ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0)
121123
ZEND_END_ARG_INFO()
122124

123-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_set_lenient, 0, 2, MAY_BE_NULL|MAY_BE_BOOL)
125+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datefmt_set_lenient, 0, 2, _IS_BOOL, 1)
124126
ZEND_ARG_OBJ_INFO(0, df, IntlDateFormatter, 0)
125127
ZEND_ARG_TYPE_INFO(0, lenient, _IS_BOOL, 0)
126128
ZEND_END_ARG_INFO()
@@ -140,7 +142,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_format_object, 0, 1, MAY
140142
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
141143
ZEND_END_ARG_INFO()
142144

143-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_parse, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
145+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_parse, 0, 2, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_FALSE)
144146
ZEND_ARG_OBJ_INFO(0, df, IntlDateFormatter, 0)
145147
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
146148
ZEND_ARG_TYPE_INFO(1, position, IS_LONG, 1)

0 commit comments

Comments
 (0)