summaryrefslogtreecommitdiff
path: root/ext/intl/common/common_enum.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/common/common_enum.cpp')
-rw-r--r--ext/intl/common/common_enum.cpp48
1 files changed, 12 insertions, 36 deletions
diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp
index adc7034d36..9d823ead57 100644
--- a/ext/intl/common/common_enum.cpp
+++ b/ext/intl/common/common_enum.cpp
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
@@ -24,6 +22,7 @@
#include <stdio.h>
#include "common_enum.h"
+#include "common_arginfo.h"
extern "C" {
#include <zend_interfaces.h>
@@ -205,15 +204,13 @@ static zend_object *IntlIterator_object_create(zend_class_entry *ce)
return &intern->zo;
}
-static PHP_METHOD(IntlIterator, current)
+PHP_METHOD(IntlIterator, current)
{
zval *data;
INTLITERATOR_METHOD_INIT_VARS;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::current: bad arguments", 0);
- return;
+ RETURN_THROWS();
}
INTLITERATOR_METHOD_FETCH_OBJECT;
@@ -223,14 +220,12 @@ static PHP_METHOD(IntlIterator, current)
}
}
-static PHP_METHOD(IntlIterator, key)
+PHP_METHOD(IntlIterator, key)
{
INTLITERATOR_METHOD_INIT_VARS;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::key: bad arguments", 0);
- return;
+ RETURN_THROWS();
}
INTLITERATOR_METHOD_FETCH_OBJECT;
@@ -242,14 +237,12 @@ static PHP_METHOD(IntlIterator, key)
}
}
-static PHP_METHOD(IntlIterator, next)
+PHP_METHOD(IntlIterator, next)
{
INTLITERATOR_METHOD_INIT_VARS;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::next: bad arguments", 0);
- return;
+ RETURN_THROWS();
}
INTLITERATOR_METHOD_FETCH_OBJECT;
@@ -259,14 +252,12 @@ static PHP_METHOD(IntlIterator, next)
ii->iterator->index++;
}
-static PHP_METHOD(IntlIterator, rewind)
+PHP_METHOD(IntlIterator, rewind)
{
INTLITERATOR_METHOD_INIT_VARS;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::rewind: bad arguments", 0);
- return;
+ RETURN_THROWS();
}
INTLITERATOR_METHOD_FETCH_OBJECT;
@@ -278,33 +269,18 @@ static PHP_METHOD(IntlIterator, rewind)
}
}
-static PHP_METHOD(IntlIterator, valid)
+PHP_METHOD(IntlIterator, valid)
{
INTLITERATOR_METHOD_INIT_VARS;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::valid: bad arguments", 0);
- return;
+ RETURN_THROWS();
}
INTLITERATOR_METHOD_FETCH_OBJECT;
RETURN_BOOL(ii->iterator->funcs->valid(ii->iterator) == SUCCESS);
}
-ZEND_BEGIN_ARG_INFO_EX(ainfo_se_void, 0, 0, 0)
-ZEND_END_ARG_INFO()
-
-static const zend_function_entry IntlIterator_class_functions[] = {
- PHP_ME(IntlIterator, current, ainfo_se_void, ZEND_ACC_PUBLIC)
- PHP_ME(IntlIterator, key, ainfo_se_void, ZEND_ACC_PUBLIC)
- PHP_ME(IntlIterator, next, ainfo_se_void, ZEND_ACC_PUBLIC)
- PHP_ME(IntlIterator, rewind, ainfo_se_void, ZEND_ACC_PUBLIC)
- PHP_ME(IntlIterator, valid, ainfo_se_void, ZEND_ACC_PUBLIC)
- PHP_FE_END
-};
-
-
/* {{{ intl_register_IntlIterator_class
* Initialize 'IntlIterator' class
*/
@@ -313,7 +289,7 @@ U_CFUNC void intl_register_IntlIterator_class(void)
zend_class_entry ce;
/* Create and register 'IntlIterator' class. */
- INIT_CLASS_ENTRY(ce, "IntlIterator", IntlIterator_class_functions);
+ INIT_CLASS_ENTRY(ce, "IntlIterator", class_IntlIterator_methods);
ce.create_object = IntlIterator_object_create;
IntlIterator_ce_ptr = zend_register_internal_class(&ce);
IntlIterator_ce_ptr->get_iterator = IntlIterator_get_iterator;