Skip to content

Commit 8bbfe17

Browse files
committed
Use new param API in tokenizer
1 parent bf422c5 commit 8bbfe17

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ext/tokenizer/tokenizer.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,11 @@ PHP_FUNCTION(token_get_all)
275275
zend_long flags = 0;
276276
zend_bool success;
277277

278-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &source, &flags) == FAILURE) {
279-
return;
280-
}
278+
ZEND_PARSE_PARAMETERS_START(1, 2)
279+
Z_PARAM_STR(source)
280+
Z_PARAM_OPTIONAL
281+
Z_PARAM_LONG(flags)
282+
ZEND_PARSE_PARAMETERS_END();
281283

282284
if (flags & TOKEN_PARSE) {
283285
success = tokenize_parse(return_value, source);
@@ -297,9 +299,9 @@ PHP_FUNCTION(token_name)
297299
{
298300
zend_long type;
299301

300-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &type) == FAILURE) {
301-
return;
302-
}
302+
ZEND_PARSE_PARAMETERS_START(1, 1)
303+
Z_PARAM_LONG(type)
304+
ZEND_PARSE_PARAMETERS_END();
303305

304306
RETVAL_STRING(get_token_type_name(type));
305307
}

0 commit comments

Comments
 (0)