diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2019-11-11 20:46:50 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-11-16 18:15:03 +0100 |
commit | 65db340ae7754cd77e26a82c50df7e44a55132c2 (patch) | |
tree | 938b47fa476e7a55ecd2c9781bc79f5491d58d32 | |
parent | 292a1aeb59f348aabed58ac4fbc1d467dde3fcea (diff) | |
download | php-git-65db340ae7754cd77e26a82c50df7e44a55132c2.tar.gz |
Add stubs for the Locale component of Intl
-rw-r--r-- | ext/intl/locale/locale.stub.php | 94 | ||||
-rw-r--r-- | ext/intl/locale/locale_arginfo.h | 117 | ||||
-rw-r--r-- | ext/intl/locale/locale_class.c | 78 | ||||
-rw-r--r-- | ext/intl/locale/locale_methods.c | 6 | ||||
-rw-r--r-- | ext/intl/php_intl.c | 62 | ||||
-rw-r--r-- | ext/intl/tests/locale/bug74993.phpt | 41 |
6 files changed, 276 insertions, 122 deletions
diff --git a/ext/intl/locale/locale.stub.php b/ext/intl/locale/locale.stub.php new file mode 100644 index 0000000000..8ad1c83b83 --- /dev/null +++ b/ext/intl/locale/locale.stub.php @@ -0,0 +1,94 @@ +<?php + +class Locale +{ + /** @return string */ + public static function getDefault() {} + + /** @return bool */ + public static function setDefault(string $locale) {} + + /** @return ?string */ + public static function getPrimaryLanguage(string $locale) {} + + /** @return ?string */ + public static function getScript(string $locale) {} + + /** @return ?string */ + public static function getRegion(string $locale) {} + + /** @return array|false|null */ + public static function getKeywords(string $locale) {} + + /** @return string|false */ + public static function getDisplayScript(string $locale, ?string $in_locale = null) {} + + /** @return string|false */ + public static function getDisplayRegion(string $locale, ?string $in_locale = null) {} + + /** @return string|false */ + public static function getDisplayName(string $locale, ?string $in_locale = null) {} + + /** @return string|false */ + public static function getDisplayLanguage(string $locale, ?string $in_locale = null) {} + + /** @return string|false */ + public static function getDisplayVariant(string $locale, ?string $in_locale = null) {} + + /** @return string|false */ + public static function composeLocale(array $subtags) {} + + /** @return ?array */ + public static function parseLocale(string $locale) {} + + /** @return ?array */ + public static function getAllVariants(string $locale) {} + + /** @return ?bool */ + public static function filterMatches(string $langtag, string $locale, bool $canonicalize = false) {} + + /** @return ?string */ + public static function lookup(array $langtag, string $locale, bool $canonicalize = false, ?string $def = null) {} + + /** @return ?string */ + public static function canonicalize(string $locale) {} + + /** @return string|false */ + public static function acceptFromHttp(string $header) {} +} + +function locale_get_default(): string {} + +function locale_set_default(string $name): bool {} + +function locale_get_primary_language(string $locale): ?string {} + +function locale_get_script(string $locale): ?string {} + +function locale_get_region(string $locale): ?string {} + +function locale_get_keywords(string $locale): array|false|null {} + +function locale_get_display_script(string $locale, ?string $in_locale = null): string|false {} + +function locale_get_display_region(string $locale, ?string $in_locale = null): string|false {} + +function locale_get_display_name(string $locale, ?string $in_locale = null): string|false {} + +function locale_get_display_language(string $locale, ?string $in_locale = null): string|false {} + +function locale_get_display_variant(string $locale, ?string $in_locale = null): string|false {} + +function locale_compose(array $subtags): string|false {} + +function locale_parse(string $locale): ?array {} + +function locale_get_all_variants(string $locale): ?array {} + +function locale_filter_matches(string $langtag, string $locale, bool $canonicalize = false): ?bool {} + +function locale_canonicalize(string $locale): ?string {} + +function locale_lookup(array $langtag, string $locale, bool $canonicalize = false, ?string $def = null): ?string {} + +function locale_accept_from_http(string $header): string|false {} diff --git a/ext/intl/locale/locale_arginfo.h b/ext/intl/locale/locale_arginfo.h new file mode 100644 index 0000000000..367d3f7ac8 --- /dev/null +++ b/ext/intl/locale/locale_arginfo.h @@ -0,0 +1,117 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_getDefault, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_setDefault, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Locale_getPrimaryLanguage arginfo_class_Locale_setDefault + +#define arginfo_class_Locale_getScript arginfo_class_Locale_setDefault + +#define arginfo_class_Locale_getRegion arginfo_class_Locale_setDefault + +#define arginfo_class_Locale_getKeywords arginfo_class_Locale_setDefault + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_getDisplayScript, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, in_locale, IS_STRING, 1) +ZEND_END_ARG_INFO() + +#define arginfo_class_Locale_getDisplayRegion arginfo_class_Locale_getDisplayScript + +#define arginfo_class_Locale_getDisplayName arginfo_class_Locale_getDisplayScript + +#define arginfo_class_Locale_getDisplayLanguage arginfo_class_Locale_getDisplayScript + +#define arginfo_class_Locale_getDisplayVariant arginfo_class_Locale_getDisplayScript + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_composeLocale, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, subtags, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +#define arginfo_class_Locale_parseLocale arginfo_class_Locale_setDefault + +#define arginfo_class_Locale_getAllVariants arginfo_class_Locale_setDefault + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_filterMatches, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, langtag, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, canonicalize, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_lookup, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, langtag, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, canonicalize, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, def, IS_STRING, 1) +ZEND_END_ARG_INFO() + +#define arginfo_class_Locale_canonicalize arginfo_class_Locale_setDefault + +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Locale_acceptFromHttp, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_locale_get_default, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_locale_set_default, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_locale_get_primary_language, 0, 1, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_locale_get_script arginfo_locale_get_primary_language + +#define arginfo_locale_get_region arginfo_locale_get_primary_language + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_locale_get_keywords, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE|MAY_BE_NULL) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_locale_get_display_script, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, in_locale, IS_STRING, 1) +ZEND_END_ARG_INFO() + +#define arginfo_locale_get_display_region arginfo_locale_get_display_script + +#define arginfo_locale_get_display_name arginfo_locale_get_display_script + +#define arginfo_locale_get_display_language arginfo_locale_get_display_script + +#define arginfo_locale_get_display_variant arginfo_locale_get_display_script + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_locale_compose, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, subtags, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_locale_parse, 0, 1, IS_ARRAY, 1) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) +ZEND_END_ARG_INFO() + +#define arginfo_locale_get_all_variants arginfo_locale_parse + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_locale_filter_matches, 0, 2, _IS_BOOL, 1) + ZEND_ARG_TYPE_INFO(0, langtag, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, canonicalize, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +#define arginfo_locale_canonicalize arginfo_locale_get_primary_language + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_locale_lookup, 0, 2, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, langtag, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, canonicalize, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, def, IS_STRING, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_locale_accept_from_http, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +ZEND_END_ARG_INFO() diff --git a/ext/intl/locale/locale_class.c b/ext/intl/locale/locale_class.c index ebfe9780e2..e7cd250308 100644 --- a/ext/intl/locale/locale_class.c +++ b/ext/intl/locale/locale_class.c @@ -18,6 +18,7 @@ #include "locale_class.h" #include "locale_methods.h" #include "locale.h" +#include "locale_arginfo.h" zend_class_entry *Locale_ce_ptr = NULL; @@ -25,70 +26,29 @@ zend_class_entry *Locale_ce_ptr = NULL; * 'Locale' class registration structures & functions */ -/* {{{ Locale methods arguments info */ -/* - * NOTE: when modifying 'locale_XX_args' do not forget to modify - * approptiate 'locale_XX_args' for the procedural API! - */ - -ZEND_BEGIN_ARG_INFO_EX( locale_0_args, 0, 0, 0 ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_arg_locale, 0, 0, 1 ) - ZEND_ARG_INFO( 0, locale ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_accept_from_http_args, 0, 0, 1 ) - ZEND_ARG_INFO( 0, header ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_compose_args, 0, 0, 1 ) - ZEND_ARG_INFO( 0, subtags ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 1 ) - ZEND_ARG_INFO( 0, locale ) - ZEND_ARG_INFO( 0, in_locale ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, 0, 2 ) - ZEND_ARG_INFO( 0, langtag ) - ZEND_ARG_INFO( 0, locale ) - ZEND_ARG_INFO( 0, canonicalize ) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, 0, 2 ) - ZEND_ARG_INFO( 0, langtag ) - ZEND_ARG_INFO( 0, locale ) - ZEND_ARG_INFO( 0, canonicalize ) - ZEND_ARG_INFO( 0, default ) -ZEND_END_ARG_INFO() - -/* }}} */ - /* {{{ Locale_class_functions * Every 'Locale' class method has an entry in this table */ static const zend_function_entry Locale_class_functions[] = { - ZEND_FENTRY( getDefault, zif_locale_get_default , locale_0_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( setDefault, zif_locale_set_default , locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getDisplayScript, ZEND_FN( locale_get_display_script ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getDisplayRegion, ZEND_FN( locale_get_display_region ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getDisplayName, ZEND_FN( locale_get_display_name ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getDisplayLanguage, ZEND_FN( locale_get_display_language ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getDisplayVariant, ZEND_FN( locale_get_display_variant ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), locale_compose_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), locale_filter_matches_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), locale_lookup_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) - ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), locale_accept_from_http_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getDefault, zif_locale_get_default , arginfo_class_Locale_getDefault , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( setDefault, zif_locale_set_default , arginfo_class_Locale_setDefault , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), arginfo_class_Locale_getPrimaryLanguage , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), arginfo_class_Locale_getScript , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), arginfo_class_Locale_getRegion , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), arginfo_class_Locale_getKeywords , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getDisplayScript, ZEND_FN( locale_get_display_script ), arginfo_class_Locale_getDisplayScript , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getDisplayRegion, ZEND_FN( locale_get_display_region ), arginfo_class_Locale_getDisplayRegion , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getDisplayName, ZEND_FN( locale_get_display_name ), arginfo_class_Locale_getDisplayName , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getDisplayLanguage, ZEND_FN( locale_get_display_language ), arginfo_class_Locale_getDisplayLanguage , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getDisplayVariant, ZEND_FN( locale_get_display_variant ), arginfo_class_Locale_getDisplayVariant , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), arginfo_class_Locale_composeLocale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), arginfo_class_Locale_parseLocale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), arginfo_class_Locale_getAllVariants , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), arginfo_class_Locale_filterMatches, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), arginfo_class_Locale_lookup, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), arginfo_class_Locale_canonicalize , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) + ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), arginfo_class_Locale_acceptFromHttp , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC ) PHP_FE_END }; /* }}} */ diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index a61aebfb36..efd909ab66 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -493,7 +493,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME intl_error_reset( NULL ); - if(zend_parse_parameters( ZEND_NUM_ARGS(), "s|s", + if(zend_parse_parameters( ZEND_NUM_ARGS(), "s|s!", &loc_name, &loc_name_len , &disp_loc_name ,&disp_loc_name_len ) == FAILURE) { @@ -1549,11 +1549,11 @@ PHP_FUNCTION(locale_lookup) /* }}} */ /* {{{ proto string Locale::acceptFromHttp(string $http_accept) -* Tries to find out best available locale based on HTTP �Accept-Language� header +* Tries to find out best available locale based on HTTP "Accept-Language" header */ /* }}} */ /* {{{ proto string locale_accept_from_http(string $http_accept) -* Tries to find out best available locale based on HTTP �Accept-Language� header +* Tries to find out best available locale based on HTTP "Accept-Language" header */ PHP_FUNCTION(locale_accept_from_http) { diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 0173de003d..585d16cab6 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -56,6 +56,7 @@ #include "locale/locale.h" #include "locale/locale_class.h" #include "locale/locale_methods.h" +#include "locale/locale_arginfo.h" #include "dateformat/dateformat.h" #include "dateformat/dateformat_class.h" @@ -169,31 +170,6 @@ ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_currency_arginfo, 0, 0, 3) ZEND_ARG_INFO(1, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX( locale_get_loc_in_loc_args, 0, ZEND_RETURN_VALUE, 1 ) - ZEND_ARG_INFO(0, locale) - ZEND_ARG_INFO(0, in_locale) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, ZEND_RETURN_VALUE, 2 ) - ZEND_ARG_INFO(0, langtag) - ZEND_ARG_INFO(0, locale) - ZEND_ARG_INFO(0, canonicalize) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, ZEND_RETURN_VALUE, 2 ) - ZEND_ARG_INFO(0, langtag) - ZEND_ARG_INFO(0, locale) - ZEND_ARG_INFO(0, canonicalize) - ZEND_ARG_INFO(0, def) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(locale_0_args, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(locale_1_arg, 0, 0, 1) - ZEND_ARG_INFO(0, arg1) -ZEND_END_ARG_INFO() - #define intl_0_args collator_static_0_args #define intl_1_arg collator_static_1_arg @@ -614,24 +590,24 @@ static const zend_function_entry intl_functions[] = { #endif /* Locale functions */ - PHP_NAMED_FE( locale_get_default, zif_locale_get_default, locale_0_args ) - PHP_NAMED_FE( locale_set_default, zif_locale_set_default, locale_1_arg ) - PHP_FE( locale_get_primary_language, locale_1_arg ) - PHP_FE( locale_get_script, locale_1_arg ) - PHP_FE( locale_get_region, locale_1_arg ) - PHP_FE( locale_get_keywords, locale_1_arg ) - PHP_FE( locale_get_display_script, locale_get_loc_in_loc_args ) - PHP_FE( locale_get_display_region, locale_get_loc_in_loc_args ) - PHP_FE( locale_get_display_name, locale_get_loc_in_loc_args ) - PHP_FE( locale_get_display_language, locale_get_loc_in_loc_args) - PHP_FE( locale_get_display_variant, locale_get_loc_in_loc_args ) - PHP_FE( locale_compose, locale_1_arg ) - PHP_FE( locale_parse, locale_1_arg ) - PHP_FE( locale_get_all_variants, locale_1_arg ) - PHP_FE( locale_filter_matches, locale_filter_matches_args ) - PHP_FE( locale_canonicalize, locale_1_arg ) - PHP_FE( locale_lookup, locale_lookup_args ) - PHP_FE( locale_accept_from_http, locale_1_arg ) + PHP_NAMED_FE( locale_get_default, zif_locale_get_default, arginfo_locale_get_default ) + PHP_NAMED_FE( locale_set_default, zif_locale_set_default, arginfo_locale_set_default ) + PHP_FE( locale_get_primary_language, arginfo_locale_get_primary_language ) + PHP_FE( locale_get_script, arginfo_locale_get_script ) + PHP_FE( locale_get_region, arginfo_locale_get_region ) + PHP_FE( locale_get_keywords, arginfo_locale_get_keywords ) + PHP_FE( locale_get_display_script, arginfo_locale_get_display_script ) + PHP_FE( locale_get_display_region, arginfo_locale_get_display_region ) + PHP_FE( locale_get_display_name, arginfo_locale_get_display_name ) + PHP_FE( locale_get_display_language, arginfo_locale_get_display_language) + PHP_FE( locale_get_display_variant, arginfo_locale_get_display_variant ) + PHP_FE( locale_compose, arginfo_locale_compose ) + PHP_FE( locale_parse, arginfo_locale_parse ) + PHP_FE( locale_get_all_variants, arginfo_locale_get_all_variants ) + PHP_FE( locale_filter_matches, arginfo_locale_filter_matches ) + PHP_FE( locale_canonicalize, arginfo_locale_canonicalize ) + PHP_FE( locale_lookup, arginfo_locale_lookup ) + PHP_FE( locale_accept_from_http, arginfo_locale_accept_from_http ) /* MessageFormatter functions */ PHP_FE( msgfmt_create, arginfo_msgfmt_create ) diff --git a/ext/intl/tests/locale/bug74993.phpt b/ext/intl/tests/locale/bug74993.phpt index 85d97ec78e..d8d8b9fada 100644 --- a/ext/intl/tests/locale/bug74993.phpt +++ b/ext/intl/tests/locale/bug74993.phpt @@ -22,52 +22,59 @@ foreach ($funcs as $func) { Function [ <internal:intl> function locale_get_display_language ] { - Parameters [2] { - Parameter #0 [ <required> $locale ] - Parameter #1 [ <optional> $in_locale ] + Parameter #0 [ <required> string $locale ] + Parameter #1 [ <optional> ?string $in_locale ] } + - Return [ string|false ] } Function [ <internal:intl> function locale_get_display_name ] { - Parameters [2] { - Parameter #0 [ <required> $locale ] - Parameter #1 [ <optional> $in_locale ] + Parameter #0 [ <required> string $locale ] + Parameter #1 [ <optional> ?string $in_locale ] } + - Return [ string|false ] } Function [ <internal:intl> function locale_get_display_region ] { - Parameters [2] { - Parameter #0 [ <required> $locale ] - Parameter #1 [ <optional> $in_locale ] + Parameter #0 [ <required> string $locale ] + Parameter #1 [ <optional> ?string $in_locale ] } + - Return [ string|false ] } Function [ <internal:intl> function locale_get_display_script ] { - Parameters [2] { - Parameter #0 [ <required> $locale ] - Parameter #1 [ <optional> $in_locale ] + Parameter #0 [ <required> string $locale ] + Parameter #1 [ <optional> ?string $in_locale ] } + - Return [ string|false ] } Function [ <internal:intl> function locale_get_display_variant ] { - Parameters [2] { - Parameter #0 [ <required> $locale ] - Parameter #1 [ <optional> $in_locale ] + Parameter #0 [ <required> string $locale ] + Parameter #1 [ <optional> ?string $in_locale ] } + - Return [ string|false ] } Function [ <internal:intl> function locale_filter_matches ] { - Parameters [3] { - Parameter #0 [ <required> $langtag ] - Parameter #1 [ <required> $locale ] - Parameter #2 [ <optional> $canonicalize ] + Parameter #0 [ <required> string $langtag ] + Parameter #1 [ <required> string $locale ] + Parameter #2 [ <optional> bool $canonicalize ] } + - Return [ ?bool ] } Function [ <internal:intl> function locale_lookup ] { - Parameters [4] { - Parameter #0 [ <required> $langtag ] - Parameter #1 [ <required> $locale ] - Parameter #2 [ <optional> $canonicalize ] - Parameter #3 [ <optional> $def ] + Parameter #0 [ <required> array $langtag ] + Parameter #1 [ <required> string $locale ] + Parameter #2 [ <optional> bool $canonicalize ] + Parameter #3 [ <optional> ?string $def ] } + - Return [ ?string ] } |