-
Notifications
You must be signed in to change notification settings - Fork 73
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
Optional parameters before required ones in constructor #280
Comments
Hi @mfickers, I'm trying to improve the way the project is managed. I created a team for reviewers "only" members so if you accept the invitation, you should be able to review and validate, if it's ok for you, the PR #282. You can test the PR using one of these phars: https://phar.wsdltophp.com/wsdltophp-feature-issue-280-php7.phar You let me know |
First of all, thank you for the quick work on that fix. I've tested the fix with the PHP 8.1 phar from your comment above, but there was no difference in the parameter order. It seems like the phar does not contain the changes, though:
|
You're right, I had modiffied my script that generates the phar, which did not check out the branch 🤦♂️ Please, download it again now and let me know, |
This issue remains on version 4.1.8, to address this I reordered these lines in from:
to:
There is probably a better way to solve this, but doing this doesn't break functionality and removes the deprecation warnings. Thank you for the library. |
Describe the bug
After upgrading our project from PHP 7.4 to PHP 8.1 this deprecation warning appeared:
Deprecated Functionality: Optional parameter $baz declared before required parameter $quux is implicitly treated as a required parameter.
To Reproduce
This type:
will result in this generated code:
It seems that nillable parameters get sorted after non-nillable parameters, but other than that, the order of the XML is kept. Parameters with default values are not ordered last and thus can not be omitted when creating an object of this class.
Expected behavior
Constructor parameters of generated classes should appear in this order:
This is the expected generated code for the given example:
Additional context
(https://www.php.net/manual/en/migration80.deprecated.php)
The text was updated successfully, but these errors were encountered: