-
Notifications
You must be signed in to change notification settings - Fork 78
Allow optional variadic arguments for methods/functions #337
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
Allow optional variadic arguments for methods/functions #337
Conversation
Thanks for the contribution. Will have a look this evening. |
Sorry, for the delay. Also you seem to need to run |
@Xenira thanks for reaching out! I have pushed code formatting into the branch, all checks should pass now! |
Hey @yoramdelangen sorry again for the delay. Maybe I did somethitg wrong, but i do not get the expected result:
Could you add some tests to clarify this? |
@Xenira I will extend/create a test for it |
@Xenira what is the best place to put these tests? Cannot really find a fitting spot for it |
I have added tests and extended the docs reflecting the option of optional args, by default it requires you to have arguments added. All remarks are welcome! Now fixing the pipelines! |
Might need to rebase on |
Fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests. Really appreciate it.
Didn't have the time to look at everything in detail yet, but this is what I noticed at a first glance. Will check it out in the next few days.
Updated PR with latest master branch changes.. |
Whoop, i just noticed my latest changes were done based upon PHP 8.4, I added the missing fields and missing cfg php84 to make sure the changes only reflect in these version. Is this the way to resolve it, or should I undo everything? Tests were running fine with no problems |
Hey @yoramdelangen based on a quick glance 739967e should have been a rebase on master. Regardless there seems to still be a issue with the integration tests. You can run just those by running |
…passed arguments tests
87dacdf
to
71c9a45
Compare
b4ff5bb
to
5e6954c
Compare
Undid the merge and rebased master ontop. Ran clippy and resolved it as well. Tests were failing due to unused parameter in function |
@yoramdelangen Hey, there seem to be conflicts again. Tried to rebase locally to check out whats wrong, and it seems its because of the php8.4 stuff. If you rebase, you likely need to adjust the commit messages of your commits to conventional commits, as the pipeline checks for those now. |
Fixes: #337 Co-authored-by: Yoram <[email protected]>
@yoramdelangen i fixed this in f819927 Part of a major rework of the macro system. I will close this now, but thank you so much for your work. Helped me a lot getting this done. |
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Thank you for keeping the project working! |
@yoramdelangen could you try the |
Fixes: #337 Co-authored-by: Yoram <[email protected]>
Yes, it still works! |
@yoramdelangen thank you. Will try to get that into master soon. But will be a bit before its released as this is a major change and I expect some bugs. |
Fixes: #337 Co-authored-by: Yoram <[email protected]>
I was implementing the variadic arguments into our extension allow for the following signatures:
This raised multiple issues for me:
#[optional(params)]
parameter forces you to set defaults. But only literals are allowed, sovec![], Vec::new(), None
etc. do not work.params: Option<&[&Zval]>
it worked.. kinda.. but raised 2 problems:Option<...>
, and then this missed the implementation forFromZvalMut
for&[&Zval]
. So I added implementation, in the PR because its nice allow handle forOption<&[&Zval]>
.Fixes
FromZvalMut
implementation for&[&Zval]
.