diff options
Diffstat (limited to 'ext/intl/dateformat')
| -rw-r--r-- | ext/intl/dateformat/dateformat.c | 5 | ||||
| -rw-r--r-- | ext/intl/dateformat/dateformat_attr.c | 14 | ||||
| -rw-r--r-- | ext/intl/dateformat/dateformat_attrcpp.cpp | 13 | ||||
| -rw-r--r-- | ext/intl/dateformat/dateformat_class.c | 6 | ||||
| -rw-r--r-- | ext/intl/dateformat/dateformat_create.cpp | 5 | ||||
| -rw-r--r-- | ext/intl/dateformat/dateformat_parse.c | 2 |
6 files changed, 4 insertions, 41 deletions
diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c index b1821ce0d3..e64b687a5b 100644 --- a/ext/intl/dateformat/dateformat.c +++ b/ext/intl/dateformat/dateformat.c @@ -77,8 +77,6 @@ PHP_FUNCTION( datefmt_get_error_code ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_error_code: unable to parse input params", 0 ); RETURN_FALSE; } @@ -103,9 +101,6 @@ PHP_FUNCTION( datefmt_get_error_message ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_error_message: unable to parse input params", 0 ); - RETURN_FALSE; } diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c index d44b3d1789..5e8f3b4454 100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.c @@ -38,8 +38,6 @@ PHP_FUNCTION( datefmt_get_datetype ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_datetype: unable to parse input params", 0 ); RETURN_FALSE; } @@ -64,8 +62,6 @@ PHP_FUNCTION( datefmt_get_timetype ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_timetype: unable to parse input params", 0 ); RETURN_FALSE; } @@ -95,8 +91,6 @@ PHP_FUNCTION( datefmt_get_pattern ) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_pattern: unable to parse input params", 0 ); RETURN_FALSE; } @@ -140,8 +134,6 @@ PHP_FUNCTION( datefmt_set_pattern ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os", &object, IntlDateFormatter_ce_ptr, &value, &value_len ) == FAILURE ) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_pattern: unable to parse input params", 0); RETURN_FALSE; } @@ -178,8 +170,6 @@ PHP_FUNCTION( datefmt_get_locale ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O|l", &object, IntlDateFormatter_ce_ptr,&loc_type) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_locale: unable to parse input params", 0 ); RETURN_FALSE; } @@ -207,8 +197,6 @@ PHP_FUNCTION( datefmt_is_lenient ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_is_lenient: unable to parse input params", 0 ); RETURN_FALSE; } @@ -235,8 +223,6 @@ PHP_FUNCTION( datefmt_set_lenient ) if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ob", &object, IntlDateFormatter_ce_ptr,&isLenient ) == FAILURE ) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_lenient: unable to parse input params", 0 ); RETURN_FALSE; } diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp index fec8eb1a67..c6cae6757b 100644 --- a/ext/intl/dateformat/dateformat_attrcpp.cpp +++ b/ext/intl/dateformat/dateformat_attrcpp.cpp @@ -49,8 +49,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_get_timezone_" - "id: unable to parse input params", 0); RETURN_FALSE; } @@ -75,8 +73,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_timezone: unable to parse input params", 0 ); RETURN_FALSE; } @@ -105,8 +101,6 @@ U_CFUNC PHP_FUNCTION(datefmt_set_timezone) if ( zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz", &object, IntlDateFormatter_ce_ptr, &timezone_zv) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_set_timezone: " - "unable to parse input params", 0); RETURN_FALSE; } @@ -132,8 +126,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_calendar: unable to parse input params", 0); RETURN_FALSE; } @@ -159,9 +151,6 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_get_calendar_object: unable to parse input params", - 0); RETURN_FALSE; } @@ -196,8 +185,6 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar) if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz", &object, IntlDateFormatter_ce_ptr, &calendar_zv) == FAILURE) { - intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, - "datefmt_set_calendar: unable to parse input params", 0); RETURN_FALSE; } diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c index b923f70508..036641cf95 100644 --- a/ext/intl/dateformat/dateformat_class.c +++ b/ext/intl/dateformat/dateformat_class.c @@ -77,14 +77,14 @@ zend_object *IntlDateFormatter_object_create(zend_class_entry *ce) /* }}} */ /* {{{ IntlDateFormatter_object_clone */ -zend_object *IntlDateFormatter_object_clone(zval *object) +zend_object *IntlDateFormatter_object_clone(zend_object *object) { IntlDateFormatter_object *dfo, *new_dfo; zend_object *new_obj; - DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; + dfo = php_intl_dateformatter_fetch_object(object); - new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object)); + new_obj = IntlDateFormatter_ce_ptr->create_object(object->ce); new_dfo = php_intl_dateformatter_fetch_object(new_obj); /* clone standard parts */ zend_objects_clone_members(&new_dfo->zo, &dfo->zo); diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp index 9268b9ddf5..fbff95743e 100644 --- a/ext/intl/dateformat/dateformat_create.cpp +++ b/ext/intl/dateformat/dateformat_create.cpp @@ -65,16 +65,13 @@ static int datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constructor) UChar* svalue = NULL; /* UTF-16 pattern_str */ int32_t slength = 0; IntlDateFormatter_object* dfo; - int zpp_flags = is_constructor ? ZEND_PARSE_PARAMS_THROW : 0; intl_error_reset(NULL); object = return_value; /* Parse parameters. */ - if (zend_parse_parameters_ex(zpp_flags, ZEND_NUM_ARGS(), "sll|zzs", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|zzs", &locale_str, &locale_len, &date_type, &time_type, &timezone_zv, &calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) { - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: " - "unable to parse input parameters", 0); return FAILURE; } diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index af96095242..2507713c8a 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -137,7 +137,6 @@ PHP_FUNCTION(datefmt_parse) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!", &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 ); RETURN_FALSE; } @@ -182,7 +181,6 @@ PHP_FUNCTION(datefmt_localtime) /* Parse parameters. */ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!", &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ - intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 ); RETURN_FALSE; } |
