Skip to content

Commit 80f92fc

Browse files
committed
Fix arginfos
1 parent 84dee6c commit 80f92fc

File tree

7 files changed

+40
-34
lines changed

7 files changed

+40
-34
lines changed

ext/intl/normalizer/normalizer.stub.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ public static function normalize(string $input, int $form = Normalizer::FORM_C)
88
/** @return bool */
99
public static function isNormalized(string $input, int $form = Normalizer::FORM_C) {}
1010

11+
#if U_ICU_VERSION_MAJOR_NUM >= 56
1112
/** @return string|null */
1213
public static function getRawDecomposition(string $input, int $form = Normalizer::FORM_C) {}
14+
#endif
1315
}
1416

1517
/** @return string|false */
1618
function normalizer_normalize(string $input, int $form = Normalizer::FORM_C) {}
1719

18-
/** @return bool */
19-
function normalizer_is_normalized(string $input, int $form = Normalizer::FORM_C) {}
20+
function normalizer_is_normalized(string $input, int $form = Normalizer::FORM_C): bool {}
2021

21-
/** @return string|null */
22-
function normalizer_get_raw_decomposition(string $input, int $form = Normalizer::FORM_C) {}
22+
#if U_ICU_VERSION_MAJOR_NUM >= 56
23+
function normalizer_get_raw_decomposition(string $input, int $form = Normalizer::FORM_C): ?string {}
24+
#endif

ext/intl/normalizer/normalizer_arginfo.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,23 @@ ZEND_END_ARG_INFO()
77

88
#define arginfo_class_Normalizer_isNormalized arginfo_class_Normalizer_normalize
99

10-
#define arginfo_class_Normalizer_getRawDecomposition arginfo_class_Normalizer_normalize
10+
#if U_ICU_VERSION_MAJOR_NUM >= 56
11+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Normalizer_getRawDecomposition, 0, 0, 1)
12+
ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0)
13+
ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0)
14+
ZEND_END_ARG_INFO()
15+
#endif
1116

1217
#define arginfo_normalizer_normalize arginfo_class_Normalizer_normalize
1318

14-
#define arginfo_normalizer_is_normalized arginfo_class_Normalizer_normalize
19+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_normalizer_is_normalized, 0, 1, _IS_BOOL, 0)
20+
ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0)
21+
ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0)
22+
ZEND_END_ARG_INFO()
1523

16-
#define arginfo_normalizer_get_raw_decomposition arginfo_class_Normalizer_normalize
24+
#if U_ICU_VERSION_MAJOR_NUM >= 56
25+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_normalizer_get_raw_decomposition, 0, 1, IS_STRING, 1)
26+
ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0)
27+
ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0)
28+
ZEND_END_ARG_INFO()
29+
#endif

ext/intl/normalizer/normalizer_class.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,6 @@ zend_class_entry *Normalizer_ce_ptr = NULL;
2626
* 'Normalizer' class registration structures & functions
2727
*/
2828

29-
/* {{{ Normalizer methods arguments info */
30-
31-
ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 )
32-
ZEND_ARG_INFO( 0, input )
33-
ZEND_ARG_INFO( 0, form )
34-
ZEND_END_ARG_INFO()
35-
36-
#if U_ICU_VERSION_MAJOR_NUM >= 56
37-
ZEND_BEGIN_ARG_INFO_EX( decomposition_args, 0, 0, 1 )
38-
ZEND_ARG_INFO( 0, input )
39-
ZEND_END_ARG_INFO();
40-
#endif
41-
42-
/* }}} */
43-
4429
/* {{{ Normalizer_class_functions
4530
* Every 'Normalizer' class method has an entry in this table
4631
*/

ext/intl/resourcebundle/resourcebundle.stub.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static function create(?string $locale, ?string $bundlename, bool $fallba
1313
*/
1414
public function get($index, bool $fallback = true) {}
1515

16-
/** @return int */
16+
/** @return int|false */
1717
public function count() {}
1818

1919
/** @return array|false */
@@ -31,18 +31,16 @@ function resourcebundle_create(?string $locale, ?string $bundlename, bool $fallb
3131

3232
/**
3333
* @param string|int $index
34-
* @return ResourceBundle|false|null
34+
* @return mixed
3535
*/
3636
function resourcebundle_get(ResourceBundle $bundle, $index) {}
3737

38-
/** @return int */
38+
/** @return int|false */
3939
function resourcebundle_count(ResourceBundle $bundle) {}
4040

4141
/** @return array|false */
4242
function resourcebundle_locales(string $bundlename) {}
4343

44-
/** @return int */
45-
function resourcebundle_get_error_code(ResourceBundle $bundle) {}
44+
function resourcebundle_get_error_code(ResourceBundle $bundle): int {}
4645

47-
/** @return string */
48-
function resourcebundle_get_error_message(ResourceBundle $bundle) {}
46+
function resourcebundle_get_error_message(ResourceBundle $bundle): string {}

ext/intl/resourcebundle/resourcebundle_arginfo.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ ZEND_END_ARG_INFO()
3737

3838
#define arginfo_resourcebundle_locales arginfo_class_ResourceBundle_getLocales
3939

40-
#define arginfo_resourcebundle_get_error_code arginfo_resourcebundle_count
40+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourcebundle_get_error_code, 0, 1, IS_LONG, 0)
41+
ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0)
42+
ZEND_END_ARG_INFO()
4143

42-
#define arginfo_resourcebundle_get_error_message arginfo_resourcebundle_count
44+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourcebundle_get_error_message, 0, 1, IS_STRING, 0)
45+
ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0)
46+
ZEND_END_ARG_INFO()

ext/intl/spoofchecker/spoofchecker.stub.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ public function isSuspicious(string $text, &$error = null) {}
1010
/** @return bool */
1111
public function areConfusable(string $s1, string $s2, &$error = null) {}
1212

13-
/** @return void */
13+
/** @return null|false */
1414
public function setAllowedLocales(string $locale_list) {}
1515

16-
/** @return void */
16+
/** @return null|false */
1717
public function setChecks(int $checks) {}
1818

19-
/** @return void */
19+
#if U_ICU_VERSION_MAJOR_NUM >= 58
20+
/** @return null|false */
2021
public function setRestrictionLevel(int $level) {}
22+
#endif
2123
}

ext/intl/spoofchecker/spoofchecker_arginfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setChecks, 0, 0, 1)
2222
ZEND_ARG_TYPE_INFO(0, checks, IS_LONG, 0)
2323
ZEND_END_ARG_INFO()
2424

25+
#if U_ICU_VERSION_MAJOR_NUM >= 58
2526
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setRestrictionLevel, 0, 0, 1)
2627
ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0)
2728
ZEND_END_ARG_INFO()
29+
#endif

0 commit comments

Comments
 (0)