mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
BreakIter: Removed getAvailableLocales/getHashCode
This commit is contained in:
parent
4ec75539db
commit
afed66bb9e
8 changed files with 0 additions and 84 deletions
|
@ -274,7 +274,6 @@ static const zend_function_entry BreakIterator_class_functions[] = {
|
|||
PHP_ME_MAPPING(createCharacterInstance, breakiter_create_character_instance, ainfo_biter_locale, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(createSentenceInstance, breakiter_create_sentence_instance, ainfo_biter_locale, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(createTitleInstance, breakiter_create_title_instance, ainfo_biter_locale, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getAvailableLocales, breakiter_get_available_locales, ainfo_biter_void, ZEND_ACC_STATIC | ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getText, breakiter_get_text, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(setText, breakiter_set_text, ainfo_biter_setText, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(first, breakiter_first, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
|
@ -298,7 +297,6 @@ static const zend_function_entry BreakIterator_class_functions[] = {
|
|||
*/
|
||||
static const zend_function_entry RuleBasedBreakIterator_class_functions[] = {
|
||||
PHP_ME(RuleBasedBreakIterator, __construct, ainfo_rbbi___construct, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(hashCode, rbbi_hash_code, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getRules, rbbi_get_rules, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getRuleStatus, rbbi_get_rule_status, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getRuleStatusVec, rbbi_get_rule_status_vec, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
|
|
|
@ -107,27 +107,6 @@ U_CFUNC PHP_FUNCTION(breakiter_create_title_instance)
|
|||
INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
|
||||
U_CFUNC PHP_FUNCTION(breakiter_get_available_locales)
|
||||
{
|
||||
intl_error_reset(NULL TSRMLS_CC);
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"breakiter_get_available_locales: bad arguments", 0 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
const Locale *locales;
|
||||
int32_t count;
|
||||
|
||||
locales = BreakIterator::getAvailableLocales(count);
|
||||
array_init_size(return_value, (uint)count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Locale locale = locales[i];
|
||||
add_next_index_string(return_value, locale.getName(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
U_CFUNC PHP_FUNCTION(breakiter_get_text)
|
||||
{
|
||||
BREAKITER_METHOD_INIT_VARS;
|
||||
|
|
|
@ -31,8 +31,6 @@ PHP_FUNCTION(breakiter_create_sentence_instance);
|
|||
|
||||
PHP_FUNCTION(breakiter_create_title_instance);
|
||||
|
||||
PHP_FUNCTION(breakiter_get_available_locales);
|
||||
|
||||
PHP_FUNCTION(breakiter_get_text);
|
||||
|
||||
PHP_FUNCTION(breakiter_set_text);
|
||||
|
|
|
@ -98,22 +98,6 @@ U_CFUNC PHP_METHOD(RuleBasedBreakIterator, __construct)
|
|||
}
|
||||
}
|
||||
|
||||
U_CFUNC PHP_FUNCTION(rbbi_hash_code)
|
||||
{
|
||||
BREAKITER_METHOD_INIT_VARS;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
|
||||
&object, BreakIterator_ce_ptr) == FAILURE) {
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"rbbi_hash_code: bad arguments", 0 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
BREAKITER_METHOD_FETCH_OBJECT;
|
||||
|
||||
RETURN_LONG(fetch_rbbi(bio)->hashCode());
|
||||
}
|
||||
|
||||
U_CFUNC PHP_FUNCTION(rbbi_get_rules)
|
||||
{
|
||||
BREAKITER_METHOD_INIT_VARS;
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
PHP_METHOD(RuleBasedBreakIterator, __construct);
|
||||
|
||||
PHP_FUNCTION(rbbi_hash_code);
|
||||
|
||||
PHP_FUNCTION(rbbi_get_rules);
|
||||
|
||||
PHP_FUNCTION(rbbi_get_rule_status);
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
--TEST--
|
||||
BreakIterator::getAvailableLocales(): basic test
|
||||
--SKIPIF--
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
var_dump(count(Breakiterator::getAvailableLocales()) > 150);
|
||||
--EXPECT--
|
||||
bool(true)
|
|
@ -1,14 +0,0 @@
|
|||
--TEST--
|
||||
BreakIterator::getAvailableLocales(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
var_dump(BreakIterator::getAvailableLocales(array()));
|
||||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::getAvailableLocales() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::getAvailableLocales(): breakiter_get_available_locales: bad arguments in %s on line %d
|
||||
bool(false)
|
|
@ -1,15 +0,0 @@
|
|||
--TEST--
|
||||
RuleBasedBreakIterator::hashCode(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$rbbi = BreakIterator::createWordInstance(NULL);
|
||||
var_dump($rbbi->hashCode());
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
int(%d)
|
||||
==DONE==
|
Loading…
Add table
Add a link
Reference in a new issue