Skip to content

Commit 86ef425

Browse files
committed
Intl: Don't separately report "bad arguments" errors
zpp will be throwing for these now, don't report them in addition to that.
1 parent 513b767 commit 86ef425

35 files changed

+1
-434
lines changed

ext/intl/breakiterator/breakiterator_iterators.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator)
277277
INTLITERATOR_METHOD_INIT_VARS;
278278

279279
if (zend_parse_parameters_none() == FAILURE) {
280-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
281-
"IntlPartsIterator::getBreakIterator: bad arguments", 0);
282280
return;
283281
}
284282

ext/intl/breakiterator/breakiterator_methods.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ static void _breakiter_factory(const char *func_name,
5555

5656
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!",
5757
&locale_str, &dummy) == FAILURE) {
58-
spprintf(&msg, 0, "%s: bad arguments", func_name);
59-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
60-
efree(msg);
6158
RETURN_NULL();
6259
}
6360

@@ -118,8 +115,6 @@ U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance)
118115
intl_error_reset(NULL);
119116

120117
if (zend_parse_parameters_none() == FAILURE) {
121-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
122-
"breakiter_create_code_point_instance: bad arguments", 0);
123118
RETURN_NULL();
124119
}
125120

@@ -133,8 +128,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_text)
133128
object = ZEND_THIS;
134129

135130
if (zend_parse_parameters_none() == FAILURE) {
136-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
137-
"breakiter_get_text: bad arguments", 0);
138131
RETURN_FALSE;
139132
}
140133

@@ -155,8 +148,6 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text)
155148
object = ZEND_THIS;
156149

157150
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &text) == FAILURE) {
158-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
159-
"breakiter_set_text: bad arguments", 0);
160151
RETURN_FALSE;
161152
}
162153

@@ -189,9 +180,6 @@ static void _breakiter_no_args_ret_int32(
189180
object = ZEND_THIS;
190181

191182
if (zend_parse_parameters_none() == FAILURE) {
192-
spprintf(&msg, 0, "%s: bad arguments", func_name);
193-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
194-
efree(msg);
195183
RETURN_FALSE;
196184
}
197185

@@ -213,9 +201,6 @@ static void _breakiter_int32_ret_int32(
213201
object = ZEND_THIS;
214202

215203
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg) == FAILURE) {
216-
spprintf(&msg, 0, "%s: bad arguments", func_name);
217-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
218-
efree(msg);
219204
RETURN_FALSE;
220205
}
221206

@@ -290,8 +275,6 @@ U_CFUNC PHP_FUNCTION(breakiter_current)
290275
object = ZEND_THIS;
291276

292277
if (zend_parse_parameters_none() == FAILURE) {
293-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
294-
"breakiter_current: bad arguments", 0);
295278
RETURN_FALSE;
296279
}
297280

@@ -324,8 +307,6 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary)
324307

325308
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l",
326309
&offset) == FAILURE) {
327-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
328-
"breakiter_is_boundary: bad arguments", 0);
329310
RETURN_FALSE;
330311
}
331312

@@ -350,8 +331,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale)
350331
object = ZEND_THIS;
351332

352333
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &locale_type) == FAILURE) {
353-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
354-
"breakiter_get_locale: bad arguments", 0);
355334
RETURN_FALSE;
356335
}
357336

@@ -378,8 +357,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
378357
object = ZEND_THIS;
379358

380359
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &key_type) == FAILURE) {
381-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
382-
"breakiter_get_parts_iterator: bad arguments", 0);
383360
RETURN_FALSE;
384361
}
385362

@@ -403,8 +380,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code)
403380
object = ZEND_THIS;
404381

405382
if (zend_parse_parameters_none() == FAILURE) {
406-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
407-
"breakiter_get_error_code: bad arguments", 0);
408383
RETURN_FALSE;
409384
}
410385

@@ -423,8 +398,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message)
423398
object = ZEND_THIS;
424399

425400
if (zend_parse_parameters_none() == FAILURE) {
426-
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
427-
"breakiter_get_error_message: bad arguments", 0 );
428401
RETURN_FALSE;
429402
}
430403

ext/intl/breakiterator/codepointiterator_methods.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point)
3333
object = ZEND_THIS;
3434

3535
if (zend_parse_parameters_none() == FAILURE) {
36-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
37-
"cpbi_get_last_code_point: bad arguments", 0);
3836
RETURN_FALSE;
3937
}
4038

ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
4343

4444
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "s|b",
4545
&rules, &rules_len, &compiled) == FAILURE) {
46-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
47-
"rbbi_create_instance: bad arguments", 0);
4846
return;
4947
}
5048

@@ -105,8 +103,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules)
105103
object = ZEND_THIS;
106104

107105
if (zend_parse_parameters_none() == FAILURE) {
108-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
109-
"rbbi_get_rules: bad arguments", 0);
110106
RETURN_FALSE;
111107
}
112108

@@ -132,8 +128,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status)
132128
object = ZEND_THIS;
133129

134130
if (zend_parse_parameters_none() == FAILURE) {
135-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
136-
"rbbi_get_rule_status: bad arguments", 0);
137131
RETURN_FALSE;
138132
}
139133

@@ -148,8 +142,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
148142
object = ZEND_THIS;
149143

150144
if (zend_parse_parameters_none() == FAILURE) {
151-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
152-
"rbbi_get_rule_status_vec: bad arguments", 0);
153145
RETURN_FALSE;
154146
}
155147

@@ -188,8 +180,6 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
188180
object = ZEND_THIS;
189181

190182
if (zend_parse_parameters_none() == FAILURE) {
191-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
192-
"rbbi_get_binary_rules: bad arguments", 0);
193183
RETURN_FALSE;
194184
}
195185

0 commit comments

Comments
 (0)