diff options
-rw-r--r-- | ext/intl/grapheme/grapheme.stub.php | 19 | ||||
-rw-r--r-- | ext/intl/grapheme/grapheme_arginfo.h | 39 | ||||
-rw-r--r-- | ext/intl/idn/idn.stub.php | 5 | ||||
-rw-r--r-- | ext/intl/idn/idn_arginfo.h | 10 | ||||
-rw-r--r-- | ext/intl/normalizer/normalizer.stub.php | 23 | ||||
-rw-r--r-- | ext/intl/normalizer/normalizer_arginfo.h | 32 | ||||
-rw-r--r-- | ext/intl/normalizer/normalizer_class.c | 22 | ||||
-rw-r--r-- | ext/intl/php_intl.c | 118 | ||||
-rw-r--r-- | ext/intl/resourcebundle/resourcebundle.stub.php | 43 | ||||
-rw-r--r-- | ext/intl/resourcebundle/resourcebundle_arginfo.h | 52 | ||||
-rw-r--r-- | ext/intl/resourcebundle/resourcebundle_class.c | 51 | ||||
-rw-r--r-- | ext/intl/spoofchecker/spoofchecker.stub.php | 23 | ||||
-rw-r--r-- | ext/intl/spoofchecker/spoofchecker_arginfo.h | 29 | ||||
-rw-r--r-- | ext/intl/spoofchecker/spoofchecker_class.c | 44 |
14 files changed, 317 insertions, 193 deletions
diff --git a/ext/intl/grapheme/grapheme.stub.php b/ext/intl/grapheme/grapheme.stub.php new file mode 100644 index 0000000000..669b590437 --- /dev/null +++ b/ext/intl/grapheme/grapheme.stub.php @@ -0,0 +1,19 @@ +<?php + +function grapheme_strlen(string $input): int|false|null {} + +function grapheme_strpos(string $haystack, string $needle, int $offset = 0): int|false {} + +function grapheme_stripos(string $haystack, string $needle, int $offset = 0): int|false {} + +function grapheme_strrpos(string $haystack, string $needle, int $offset = 0): int|false {} + +function grapheme_strripos(string $haystack, string $needle, int $offset = 0): int|false {} + +function grapheme_substr(string $string, int $start, ?int $length = 0): string|false {} + +function grapheme_strstr(string $haystack, string $needle, bool $before_needle = false): string|false {} + +function grapheme_stristr(string $haystack, string $needle, bool $before_needle = false): string|false {} + +function grapheme_extract(string $haystack, int $size, int $extract_type = GRAPHEME_EXTR_COUNT, int $start = 0, &$next = null): string|false {} diff --git a/ext/intl/grapheme/grapheme_arginfo.h b/ext/intl/grapheme/grapheme_arginfo.h new file mode 100644 index 0000000000..1dc2e95199 --- /dev/null +++ b/ext/intl/grapheme/grapheme_arginfo.h @@ -0,0 +1,39 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_grapheme_strlen, 0, 1, MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_NULL) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_grapheme_strpos, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_grapheme_stripos arginfo_grapheme_strpos + +#define arginfo_grapheme_strrpos arginfo_grapheme_strpos + +#define arginfo_grapheme_strripos arginfo_grapheme_strpos + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_grapheme_substr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_grapheme_strstr, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, needle, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, before_needle, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_grapheme_stristr arginfo_grapheme_strstr + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_grapheme_extract, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, haystack, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, extract_type, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) + ZEND_ARG_INFO(1, next) +ZEND_END_ARG_INFO() diff --git a/ext/intl/idn/idn.stub.php b/ext/intl/idn/idn.stub.php new file mode 100644 index 0000000000..7407b60a20 --- /dev/null +++ b/ext/intl/idn/idn.stub.php @@ -0,0 +1,5 @@ +<?php + +function idn_to_ascii(string $domain, int $options = 0, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false {} + +function idn_to_utf8(string $domain, int $options = 0, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false {} diff --git a/ext/intl/idn/idn_arginfo.h b/ext/intl/idn/idn_arginfo.h new file mode 100644 index 0000000000..7e107f4f9c --- /dev/null +++ b/ext/intl/idn/idn_arginfo.h @@ -0,0 +1,10 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_idn_to_ascii, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, variant, IS_LONG, 0) + ZEND_ARG_INFO(1, idna_info) +ZEND_END_ARG_INFO() + +#define arginfo_idn_to_utf8 arginfo_idn_to_ascii diff --git a/ext/intl/normalizer/normalizer.stub.php b/ext/intl/normalizer/normalizer.stub.php new file mode 100644 index 0000000000..f0d55738f6 --- /dev/null +++ b/ext/intl/normalizer/normalizer.stub.php @@ -0,0 +1,23 @@ +<?php + +class Normalizer +{ + /** @return string|false */ + public static function normalize(string $input, int $form = Normalizer::FORM_C) {} + + /** @return bool */ + public static function isNormalized(string $input, int $form = Normalizer::FORM_C) {} + +#if U_ICU_VERSION_MAJOR_NUM >= 56 + /** @return string|null */ + public static function getRawDecomposition(string $input, int $form = Normalizer::FORM_C) {} +#endif +} + +function normalizer_normalize(string $input, int $form = Normalizer::FORM_C): string|false {} + +function normalizer_is_normalized(string $input, int $form = Normalizer::FORM_C): bool {} + +#if U_ICU_VERSION_MAJOR_NUM >= 56 +function normalizer_get_raw_decomposition(string $input, int $form = Normalizer::FORM_C): ?string {} +#endif diff --git a/ext/intl/normalizer/normalizer_arginfo.h b/ext/intl/normalizer/normalizer_arginfo.h new file mode 100644 index 0000000000..858b2fe12d --- /dev/null +++ b/ext/intl/normalizer/normalizer_arginfo.h @@ -0,0 +1,32 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Normalizer_normalize, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Normalizer_isNormalized arginfo_class_Normalizer_normalize + +#if U_ICU_VERSION_MAJOR_NUM >= 56 +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Normalizer_getRawDecomposition, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_normalizer_normalize, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_normalizer_is_normalized, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#if U_ICU_VERSION_MAJOR_NUM >= 56 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_normalizer_get_raw_decomposition, 0, 1, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, form, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.c index ec96a163e9..0b6033893c 100644 --- a/ext/intl/normalizer/normalizer_class.c +++ b/ext/intl/normalizer/normalizer_class.c @@ -15,6 +15,7 @@ #include "normalizer_class.h" #include "php_intl.h" #include "normalizer_normalize.h" +#include "normalizer_arginfo.h" #include "intl_error.h" #include <unicode/unorm.h> @@ -25,30 +26,15 @@ zend_class_entry *Normalizer_ce_ptr = NULL; * 'Normalizer' class registration structures & functions */ -/* {{{ Normalizer methods arguments info */ - -ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 ) - ZEND_ARG_INFO( 0, input ) - ZEND_ARG_INFO( 0, form ) -ZEND_END_ARG_INFO() - -#if U_ICU_VERSION_MAJOR_NUM >= 56 -ZEND_BEGIN_ARG_INFO_EX( decomposition_args, 0, 0, 1 ) - ZEND_ARG_INFO( 0, input ) -ZEND_END_ARG_INFO(); -#endif - -/* }}} */ - /* {{{ Normalizer_class_functions * Every 'Normalizer' class method has an entry in this table */ static const zend_function_entry Normalizer_class_functions[] = { - ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), arginfo_class_Normalizer_normalize, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), arginfo_class_Normalizer_isNormalized, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) #if U_ICU_VERSION_MAJOR_NUM >= 56 - ZEND_FENTRY( getRawDecomposition, ZEND_FN( normalizer_get_raw_decomposition ), decomposition_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getRawDecomposition, ZEND_FN( normalizer_get_raw_decomposition ), arginfo_class_Normalizer_getRawDecomposition, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) #endif PHP_FE_END }; diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 95481aab79..9d963449a5 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -42,6 +42,7 @@ #include "formatter/formatter_parse.h" #include "grapheme/grapheme.h" +#include "grapheme/grapheme_arginfo.h" #include "msgformat/msgformat.h" #include "msgformat/msgformat_class.h" @@ -52,6 +53,7 @@ #include "normalizer/normalizer.h" #include "normalizer/normalizer_class.h" #include "normalizer/normalizer_normalize.h" +#include "normalizer/normalizer_arginfo.h" #include "locale/locale.h" #include "locale/locale_class.h" @@ -68,6 +70,7 @@ #include "dateformat/dateformat_data.h" #include "resourcebundle/resourcebundle_class.h" +#include "resourcebundle/resourcebundle_arginfo.h" #include "transliterator/transliterator.h" #include "transliterator/transliterator_class.h" @@ -85,6 +88,7 @@ #include "breakiterator/breakiterator_iterators.h" #include "idn/idn.h" +#include "idn/idn_arginfo.h" #include "uchar/uchar.h" # include "spoofchecker/spoofchecker_class.h" @@ -173,47 +177,6 @@ ZEND_END_ARG_INFO() #define intl_0_args collator_static_0_args #define intl_1_arg collator_static_1_arg -ZEND_BEGIN_ARG_INFO_EX(normalizer_args, 0, 0, 1) - ZEND_ARG_INFO(0, input) - ZEND_ARG_INFO(0, form) -ZEND_END_ARG_INFO() - -#if U_ICU_VERSION_MAJOR_NUM >= 56 -ZEND_BEGIN_ARG_INFO_EX(decomposition_args, 0, 0, 1) - ZEND_ARG_INFO(0, input) -ZEND_END_ARG_INFO(); -#endif - -ZEND_BEGIN_ARG_INFO_EX(grapheme_1_arg, 0, 0, 1) - ZEND_ARG_INFO(0, string) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(grapheme_search_args, 0, 0, 2) - ZEND_ARG_INFO(0, haystack) - ZEND_ARG_INFO(0, needle) - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(grapheme_substr_args, 0, 0, 2) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(0, start) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(grapheme_strstr_args, 0, 0, 2) - ZEND_ARG_INFO(0, haystack) - ZEND_ARG_INFO(0, needle) - ZEND_ARG_INFO(0, before_needle) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(grapheme_extract_args, 0, 0, 2) - ZEND_ARG_INFO(0, arg1) - ZEND_ARG_INFO(0, arg2) - ZEND_ARG_INFO(0, arg3) - ZEND_ARG_INFO(0, arg4) - ZEND_ARG_INFO(1, arg5) /* 1 = pass by reference */ -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(datefmt_parse_args, 0, 0, 2) ZEND_ARG_INFO(0, formatter) ZEND_ARG_INFO(0, string) @@ -349,41 +312,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_create, 0, 0, 3) ZEND_ARG_INFO(0, pattern) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_idn_to_ascii, 0, 0, 1) - ZEND_ARG_INFO(0, domain) - ZEND_ARG_INFO(0, option) - ZEND_ARG_INFO(0, variant) - ZEND_ARG_INFO(1, idn_info) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_create_proc, 0, 0, 2 ) - ZEND_ARG_INFO( 0, locale ) - ZEND_ARG_INFO( 0, bundlename ) - ZEND_ARG_INFO( 0, fallback ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_proc, 0, 0, 2 ) - ZEND_ARG_INFO( 0, bundle ) - ZEND_ARG_INFO( 0, index ) - ZEND_ARG_INFO( 0, fallback ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_count_proc, 0, 0, 1 ) - ZEND_ARG_INFO( 0, bundle ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_locales_proc, 0, 0, 1 ) - ZEND_ARG_INFO( 0, bundlename ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_code_proc, 0, 0, 1 ) - ZEND_ARG_INFO( 0, bundle ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_message_proc, 0, 0, 1 ) - ZEND_ARG_INFO( 0, bundle ) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX( arginfo_transliterator_void, 0, 0, 0 ) ZEND_END_ARG_INFO() @@ -583,10 +511,10 @@ static const zend_function_entry intl_functions[] = { PHP_FE( numfmt_get_error_message, arginfo_numfmt_get_error_code ) /* normalizer functions */ - PHP_FE( normalizer_normalize, normalizer_args ) - PHP_FE( normalizer_is_normalized, normalizer_args ) + PHP_FE( normalizer_normalize, arginfo_normalizer_normalize ) + PHP_FE( normalizer_is_normalized, arginfo_normalizer_is_normalized ) #if U_ICU_VERSION_MAJOR_NUM >= 56 - PHP_FE( normalizer_get_raw_decomposition, decomposition_args ) + PHP_FE( normalizer_get_raw_decomposition, arginfo_normalizer_get_raw_decomposition ) #endif /* Locale functions */ @@ -644,27 +572,27 @@ static const zend_function_entry intl_functions[] = { PHP_FE( datefmt_get_error_message, arginfo_msgfmt_get_error_message ) /* grapheme functions */ - PHP_FE( grapheme_strlen, grapheme_1_arg ) - PHP_FE( grapheme_strpos, grapheme_search_args ) - PHP_FE( grapheme_stripos, grapheme_search_args ) - PHP_FE( grapheme_strrpos, grapheme_search_args ) - PHP_FE( grapheme_strripos, grapheme_search_args ) - PHP_FE( grapheme_substr, grapheme_substr_args ) - PHP_FE( grapheme_strstr, grapheme_strstr_args ) - PHP_FE( grapheme_stristr, grapheme_strstr_args ) - PHP_FE( grapheme_extract, grapheme_extract_args ) + PHP_FE( grapheme_strlen, arginfo_grapheme_strlen ) + PHP_FE( grapheme_strpos, arginfo_grapheme_strpos ) + PHP_FE( grapheme_stripos, arginfo_grapheme_stripos ) + PHP_FE( grapheme_strrpos, arginfo_grapheme_strrpos ) + PHP_FE( grapheme_strripos, arginfo_grapheme_strripos ) + PHP_FE( grapheme_substr, arginfo_grapheme_substr ) + PHP_FE( grapheme_strstr, arginfo_grapheme_strstr ) + PHP_FE( grapheme_stristr, arginfo_grapheme_stristr ) + PHP_FE( grapheme_extract, arginfo_grapheme_extract ) /* IDN functions */ PHP_FE( idn_to_ascii, arginfo_idn_to_ascii) - PHP_FE( idn_to_utf8, arginfo_idn_to_ascii) + PHP_FE( idn_to_utf8, arginfo_idn_to_utf8) /* ResourceBundle functions */ - PHP_FE( resourcebundle_create, arginfo_resourcebundle_create_proc ) - PHP_FE( resourcebundle_get, arginfo_resourcebundle_get_proc ) - PHP_FE( resourcebundle_count, arginfo_resourcebundle_count_proc ) - PHP_FE( resourcebundle_locales, arginfo_resourcebundle_locales_proc ) - PHP_FE( resourcebundle_get_error_code, arginfo_resourcebundle_get_error_code_proc ) - PHP_FE( resourcebundle_get_error_message, arginfo_resourcebundle_get_error_message_proc ) + PHP_FE( resourcebundle_create, arginfo_resourcebundle_create ) + PHP_FE( resourcebundle_get, arginfo_resourcebundle_get ) + PHP_FE( resourcebundle_count, arginfo_resourcebundle_count ) + PHP_FE( resourcebundle_locales, arginfo_resourcebundle_locales ) + PHP_FE( resourcebundle_get_error_code, arginfo_resourcebundle_get_error_code ) + PHP_FE( resourcebundle_get_error_message, arginfo_resourcebundle_get_error_message ) /* Transliterator functions */ PHP_FE( transliterator_create, arginfo_transliterator_create ) diff --git a/ext/intl/resourcebundle/resourcebundle.stub.php b/ext/intl/resourcebundle/resourcebundle.stub.php new file mode 100644 index 0000000000..f3f0dcef1a --- /dev/null +++ b/ext/intl/resourcebundle/resourcebundle.stub.php @@ -0,0 +1,43 @@ +<?php + +class ResourceBundle implements Traversable +{ + public function __construct(?string $locale, ?string $bundlename, bool $fallback = true) {} + + /** @return ResourceBundle|null */ + public static function create(?string $locale, ?string $bundlename, bool $fallback = true) {} + + /** + * @param string|int $index + * @return mixed + */ + public function get($index, bool $fallback = true) {} + + /** @return int|false */ + public function count() {} + + /** @return array|false */ + public static function getLocales(string $bundlename) {} + + /** @return int */ + public function getErrorCode() {} + + /** @return string */ + public function getErrorMessage() {} +} + +function resourcebundle_create(?string $locale, ?string $bundlename, bool $fallback = true): ?ResourceBundle {} + +/** + * @param string|int $index + * @return mixed + */ +function resourcebundle_get(ResourceBundle $bundle, $index) {} + +function resourcebundle_count(ResourceBundle $bundle): int|false {} + +function resourcebundle_locales(string $bundlename): array|false {} + +function resourcebundle_get_error_code(ResourceBundle $bundle): int {} + +function resourcebundle_get_error_message(ResourceBundle $bundle): string {} diff --git a/ext/intl/resourcebundle/resourcebundle_arginfo.h b/ext/intl/resourcebundle/resourcebundle_arginfo.h new file mode 100644 index 0000000000..9c4fbf088f --- /dev/null +++ b/ext/intl/resourcebundle/resourcebundle_arginfo.h @@ -0,0 +1,52 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle___construct, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, bundlename, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, fallback, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_ResourceBundle_create arginfo_class_ResourceBundle___construct + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle_get, 0, 0, 1) + ZEND_ARG_INFO(0, index) + ZEND_ARG_TYPE_INFO(0, fallback, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle_count, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ResourceBundle_getLocales, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, bundlename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_ResourceBundle_getErrorCode arginfo_class_ResourceBundle_count + +#define arginfo_class_ResourceBundle_getErrorMessage arginfo_class_ResourceBundle_count + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_resourcebundle_create, 0, 2, ResourceBundle, 1) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, bundlename, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, fallback, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_resourcebundle_get, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0) + ZEND_ARG_INFO(0, index) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_resourcebundle_count, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_resourcebundle_locales, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, bundlename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourcebundle_get_error_code, 0, 1, IS_LONG, 0) + ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourcebundle_get_error_message, 0, 1, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0) +ZEND_END_ARG_INFO() diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c index 8aa18e9f8e..3e38d6f9f0 100644 --- a/ext/intl/resourcebundle/resourcebundle_class.c +++ b/ext/intl/resourcebundle/resourcebundle_class.c @@ -28,6 +28,7 @@ #include "resourcebundle/resourcebundle.h" #include "resourcebundle/resourcebundle_iterator.h" #include "resourcebundle/resourcebundle_class.h" +#include "resourcebundle/resourcebundle_arginfo.h" zend_class_entry *ResourceBundle_ce_ptr = NULL; @@ -131,14 +132,6 @@ static int resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS) } /* }}} */ -/* {{{ arginfo_resourcebundle__construct */ -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle___construct, 0, 0, 2 ) - ZEND_ARG_INFO( 0, locale ) - ZEND_ARG_INFO( 0, bundlename ) - ZEND_ARG_INFO( 0, fallback ) -ZEND_END_ARG_INFO() -/* }}} */ - /* {{{ proto ResourceBundle::__construct( string $locale [, string $bundlename [, bool $fallback = true ]] ) * ResourceBundle object constructor */ @@ -236,13 +229,6 @@ zval *resourcebundle_array_get(zend_object *object, zval *offset, int type, zval } /* }}} */ -/* {{{ arginfo_resourcebundle_get */ -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get, 0, 0, 1 ) - ZEND_ARG_INFO( 0, index ) - ZEND_ARG_INFO( 0, fallback ) -ZEND_END_ARG_INFO() -/* }}} */ - /* {{{ proto mixed ResourceBundle::get( int|string $resindex [, bool $fallback = true ] ) * proto mixed resourcebundle_get( ResourceBundle $rb, int|string $resindex [, bool $fallback = true ] ) * Get resource identified by numerical index or key name. @@ -278,11 +264,6 @@ int resourcebundle_array_count(zend_object *object, zend_long *count) } /* }}} */ -/* {{{ arginfo_resourcebundle_count */ -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_count, 0, 0, 0 ) -ZEND_END_ARG_INFO() -/* }}} */ - /* {{{ proto int ResourceBundle::count() * proto int resourcebundle_count( ResourceBundle $bundle ) * Get resources count @@ -302,12 +283,6 @@ PHP_FUNCTION( resourcebundle_count ) RETURN_LONG( len ); } -/* {{{ arginfo_resourcebundle_getlocales */ -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_getlocales, 0, 0, 1 ) - ZEND_ARG_INFO( 0, bundlename ) -ZEND_END_ARG_INFO() -/* }}} */ - /* {{{ proto array ResourceBundle::getLocales( string $bundlename ) * proto array resourcebundle_locales( string $bundlename ) * Get available locales from ResourceBundle name @@ -352,11 +327,6 @@ PHP_FUNCTION( resourcebundle_locales ) } /* }}} */ -/* {{{ arginfo_resourcebundle_get_error_code */ -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_code, 0, 0, 0 ) -ZEND_END_ARG_INFO() -/* }}} */ - /* {{{ proto string ResourceBundle::getErrorCode( ) * proto string resourcebundle_get_error_code( ResourceBundle $bundle ) * Get text description for ResourceBundle's last error code. @@ -377,11 +347,6 @@ PHP_FUNCTION( resourcebundle_get_error_code ) } /* }}} */ -/* {{{ arginfo_resourcebundle_get_error_message */ -ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_message, 0, 0, 0 ) -ZEND_END_ARG_INFO() -/* }}} */ - /* {{{ proto string ResourceBundle::getErrorMessage( ) * proto string resourcebundle_get_error_message( ResourceBundle $bundle ) * Get text description for ResourceBundle's last error. @@ -407,13 +372,13 @@ PHP_FUNCTION( resourcebundle_get_error_message ) * Every 'ResourceBundle' class method has an entry in this table */ static const zend_function_entry ResourceBundle_class_functions[] = { - PHP_ME( ResourceBundle, __construct, arginfo_resourcebundle___construct, ZEND_ACC_PUBLIC ) - ZEND_NAMED_ME( create, ZEND_FN( resourcebundle_create ), arginfo_resourcebundle___construct, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_NAMED_ME( get, ZEND_FN(resourcebundle_get), arginfo_resourcebundle_get, ZEND_ACC_PUBLIC ) - ZEND_NAMED_ME( count, ZEND_FN(resourcebundle_count), arginfo_resourcebundle_count, ZEND_ACC_PUBLIC ) - ZEND_NAMED_ME( getLocales, ZEND_FN(resourcebundle_locales), arginfo_resourcebundle_getlocales, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC ) - ZEND_NAMED_ME( getErrorCode, ZEND_FN(resourcebundle_get_error_code), arginfo_resourcebundle_get_error_code, ZEND_ACC_PUBLIC ) - ZEND_NAMED_ME( getErrorMessage, ZEND_FN(resourcebundle_get_error_message), arginfo_resourcebundle_get_error_message, ZEND_ACC_PUBLIC ) + PHP_ME( ResourceBundle, __construct, arginfo_class_ResourceBundle___construct, ZEND_ACC_PUBLIC ) + ZEND_NAMED_ME( create, ZEND_FN( resourcebundle_create ), arginfo_class_ResourceBundle_create, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_NAMED_ME( get, ZEND_FN(resourcebundle_get), arginfo_class_ResourceBundle_get, ZEND_ACC_PUBLIC ) + ZEND_NAMED_ME( count, ZEND_FN(resourcebundle_count), arginfo_class_ResourceBundle_count, ZEND_ACC_PUBLIC ) + ZEND_NAMED_ME( getLocales, ZEND_FN(resourcebundle_locales), arginfo_class_ResourceBundle_getLocales, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC ) + ZEND_NAMED_ME( getErrorCode, ZEND_FN(resourcebundle_get_error_code), arginfo_class_ResourceBundle_getErrorCode, ZEND_ACC_PUBLIC ) + ZEND_NAMED_ME( getErrorMessage, ZEND_FN(resourcebundle_get_error_message), arginfo_class_ResourceBundle_getErrorMessage, ZEND_ACC_PUBLIC ) PHP_FE_END }; /* }}} */ diff --git a/ext/intl/spoofchecker/spoofchecker.stub.php b/ext/intl/spoofchecker/spoofchecker.stub.php new file mode 100644 index 0000000000..1609aa03c1 --- /dev/null +++ b/ext/intl/spoofchecker/spoofchecker.stub.php @@ -0,0 +1,23 @@ +<?php + +class Spoofchecker +{ + public function __construct() {} + + /** @return bool */ + public function isSuspicious(string $text, &$error = null) {} + + /** @return bool */ + public function areConfusable(string $s1, string $s2, &$error = null) {} + + /** @return null|false */ + public function setAllowedLocales(string $locale_list) {} + + /** @return null|false */ + public function setChecks(int $checks) {} + +#if U_ICU_VERSION_MAJOR_NUM >= 58 + /** @return null|false */ + public function setRestrictionLevel(int $level) {} +#endif +} diff --git a/ext/intl/spoofchecker/spoofchecker_arginfo.h b/ext/intl/spoofchecker/spoofchecker_arginfo.h new file mode 100644 index 0000000000..8572460fd3 --- /dev/null +++ b/ext/intl/spoofchecker/spoofchecker_arginfo.h @@ -0,0 +1,29 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker___construct, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_isSuspicious, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) + ZEND_ARG_INFO(1, error) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_areConfusable, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, s1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, s2, IS_STRING, 0) + ZEND_ARG_INFO(1, error) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setAllowedLocales, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, locale_list, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setChecks, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, checks, IS_LONG, 0) +ZEND_END_ARG_INFO() + +#if U_ICU_VERSION_MAJOR_NUM >= 58 +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Spoofchecker_setRestrictionLevel, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c index 87f40fef49..e6fdcefa08 100644 --- a/ext/intl/spoofchecker/spoofchecker_class.c +++ b/ext/intl/spoofchecker/spoofchecker_class.c @@ -15,6 +15,7 @@ #include "spoofchecker_class.h" #include "spoofchecker_main.h" #include "spoofchecker_create.h" +#include "spoofchecker_arginfo.h" #include "php_intl.h" #include "intl_error.h" @@ -58,49 +59,18 @@ zend_object *Spoofchecker_object_create(zend_class_entry *ce) * 'Spoofchecker' class registration structures & functions */ -/* {{{ Spoofchecker methods arguments info */ -ZEND_BEGIN_ARG_INFO_EX(spoofchecker_0_args, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(spoofchecker_set_checks, 0, 0, 1) - ZEND_ARG_INFO(0, checks) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(spoofchecker_set_allowed_locales, 0, 0, 1) - ZEND_ARG_INFO(0, locale_list) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(spoofchecker_is_suspicous, 0, 0, 1) - ZEND_ARG_INFO(0, text) - ZEND_ARG_INFO(1, error) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(spoofchecker_are_confusable, 0, 0, 2) - ZEND_ARG_INFO(0, s1) - ZEND_ARG_INFO(0, s2) - ZEND_ARG_INFO(1, error) -ZEND_END_ARG_INFO() - -#if U_ICU_VERSION_MAJOR_NUM >= 58 -ZEND_BEGIN_ARG_INFO_EX(spoofchecker_set_restriction_level, 0, 0, 1) - ZEND_ARG_INFO(0, level) -ZEND_END_ARG_INFO() -#endif - -/* }}} */ - /* {{{ Spoofchecker_class_functions * Every 'Spoofchecker' class method has an entry in this table */ static const zend_function_entry Spoofchecker_class_functions[] = { - PHP_ME(Spoofchecker, __construct, spoofchecker_0_args, ZEND_ACC_PUBLIC) - PHP_ME(Spoofchecker, isSuspicious, spoofchecker_is_suspicous, ZEND_ACC_PUBLIC) - PHP_ME(Spoofchecker, areConfusable, spoofchecker_are_confusable, ZEND_ACC_PUBLIC) - PHP_ME(Spoofchecker, setAllowedLocales, spoofchecker_set_allowed_locales, ZEND_ACC_PUBLIC) - PHP_ME(Spoofchecker, setChecks, spoofchecker_set_checks, ZEND_ACC_PUBLIC) + PHP_ME(Spoofchecker, __construct, arginfo_class_Spoofchecker___construct, ZEND_ACC_PUBLIC) + PHP_ME(Spoofchecker, isSuspicious, arginfo_class_Spoofchecker_isSuspicious, ZEND_ACC_PUBLIC) + PHP_ME(Spoofchecker, areConfusable, arginfo_class_Spoofchecker_areConfusable, ZEND_ACC_PUBLIC) + PHP_ME(Spoofchecker, setAllowedLocales, arginfo_class_Spoofchecker_setAllowedLocales, ZEND_ACC_PUBLIC) + PHP_ME(Spoofchecker, setChecks, arginfo_class_Spoofchecker_setChecks, ZEND_ACC_PUBLIC) #if U_ICU_VERSION_MAJOR_NUM >= 58 - PHP_ME(Spoofchecker, setRestrictionLevel, spoofchecker_set_restriction_level, ZEND_ACC_PUBLIC) + PHP_ME(Spoofchecker, setRestrictionLevel, arginfo_class_Spoofchecker_setRestrictionLevel, ZEND_ACC_PUBLIC) #endif PHP_FE_END }; |