Skip to content

Refactor GregorianCalendar constructor #7605

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

Closed
wants to merge 1 commit into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Oct 21, 2021

This really ought to be two separate static constructors but this at least makes this usable with 4 args.

@Girgias Girgias force-pushed the gregoriancal-constructor branch from 3d4a2fd to a7968a3 Compare October 21, 2021 15:48
@Girgias
Copy link
Member Author

Girgias commented Oct 21, 2021

CI Failure is unrelated.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure @kocsismate proposed something like this in the past. Same response here: Using single-signature zpp in this way is inappropriate for heavily overloaded methods like this. There is no single signature here, and pretending there is makes things worse, not better.

@kocsismate
Copy link
Member

Pretty sure kocsismate proposed something like this in the past.

Yes, and at last I created #6754. I also think that going with a similar approach would be better in this case as well.

I plan to prepare an RFC which would deprecate the overloaded signatures where possible, but I haven't yet managed to start working on the proposal.

@Girgias
Copy link
Member Author

Girgias commented Nov 3, 2021

Pretty sure @kocsismate proposed something like this in the past. Same response here: Using single-signature zpp in this way is inappropriate for heavily overloaded methods like this. There is no single signature here, and pretending there is makes things worse, not better.

Must have missed that one, my main work logic was to get rid of the zend_get_parameters_array_ex() call, and to get rid of the no 4 param variant, as it doesn't really make a lot of sense. Would this be better if it uses 2 ZPP calls, one for the Timezone/Locale version and another for the date variant? As this would still be overloaded, but at least prevent the bonkers case where you can just toss null at the end in a variant which makes utterly no sense.

@Girgias
Copy link
Member Author

Girgias commented Jun 29, 2023

@Girgias Girgias closed this Jun 29, 2023
@Girgias Girgias deleted the gregoriancal-constructor branch June 29, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants