Skip to content
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

Various fixes #177

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

metalinspired
Copy link

Here is a list of changes I have made (hopefully I did not forget something):

  • Dropped support for PHP 7.
  • Fixed converting Any element. Since I actually do not need this element I only went so far to make the convertion work when this element is used. It seems to work fine, even wrote a test, but I'll let you be the judge of that.
  • Fixed few "visit" methods that were missing Choice and Group as child elements.
  • Fixed converting Choice that is inside of a GroupRef that has maxOccurs set to unbounded converted as property of that type instead being an array.
  • Fixed properties/methods duplicated in extending class.
  • Properties are now protected by default.
  • Return type hint is now "static" as some IDEs complain how methods do not exist in extending classes when it is set to "self".
  • Added support for "fixed" and "default" values. For "fixed" values, the setter still exists in PHP code but is not present in JMS definition. This was the simplest solution since I did not wanted to mess with PHP inheritance rules.
  • Added "strict_types" option to configuration.
  • Added types to properties/arguments/return values in some places.

Note that all my work is based on converting XZuFi 2.3.
So far everything seems to work as expected and soon I will be using generated classes and (de)serialization in customer code, which will in it self be a test if I broke something 😄

Oh and another thing, if you run the tests (all of them) it might happen that OTA tests fail but it seems that it is a bug in JMS as one interface defines "parse(): array" but class implementing it returns a string.

@goetas
Copy link
Member

goetas commented Nov 22, 2024

oh, this looks actually super great!!
On the other hand looks very hard to review... are your changes "per" commit?
Is there any chance you could split it into multiple pull requests?

@metalinspired
Copy link
Author

Turns out there was an issue I missed and caught when trying to serialize.
Some elements were being qualified when they should not have been.
It is fixed in last commit.
Unfortunately I have not been so tidy to do each change per commit.
The customer approved the time for me to fix the issues we were facing and I doubt I'll get the time (personal included) to split it into multiple PRs.
All I can tell you is that we are now getting classes as we would expect and they serialize just fine to XML which is then validated by another service, before they import it, and validation passes with a green light.

@metalinspired
Copy link
Author

metalinspired commented Nov 26, 2024

Also I removed removing the setter in JMS definition.
I figured it might break old code that implicitly set values for fields that are now populated with fixed/default data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants