Skip to content

refactor: use ZEND_PARSE_PARAMETERS_NONE in spl_iterators.c #14442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

morrisonlevi
Copy link
Contributor

Prefer:

	ZEND_PARSE_PARAMETERS_NONE();

Over:

	if (zend_parse_parameters_none() == FAILURE) {
		RETURN_THROWS();
	}

It's shorter, more modern, and they do the same thing. Technically, ZEND_PARSE_PARAMETERS_NONE doesn't check that there's an exception, but it generates one, so it's still cohesive.

Prefer:

	ZEND_PARSE_PARAMETERS_NONE();

Over:

	if (zend_parse_parameters_none() == FAILURE) {
		RETURN_THROWS();
	}

It's shorter, more modern, and they do the same thing. Technically,
ZEND_PARSE_PARAMETERS_NONE doesn't check that there's an exception,
but it generates one, so it's still cohesive.
@morrisonlevi morrisonlevi changed the title refactor: use ZEND_PARSE_PARAMETERS_NONE in spl_iterators.c refactor: use ZEND_PARSE_PARAMETERS_NONE in spl_iterators.c Jun 2, 2024
@morrisonlevi morrisonlevi marked this pull request as ready for review June 2, 2024 20:43
@morrisonlevi morrisonlevi requested a review from Girgias as a code owner June 2, 2024 20:43
@Girgias Girgias merged commit 07a1921 into php:master Jun 2, 2024
11 checks passed
@morrisonlevi morrisonlevi deleted the ZEND_PARSE_PARAMETERS_NONE branch June 3, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants