WsdlToPhp / PackageGenerator

Generates a PHP SDK based on a WSDL, simple and powerful, WSDL to PHP
https://providr.io
MIT License
422 stars 73 forks source link

Feature/issue 124 #234

Closed mikaelcom closed 3 years ago

mikaelcom commented 3 years ago

Implementations required to fix #124 and #179

mikaelcom commented 3 years ago

Anyone who has time to review the changes is welcome to add code-review comments :sweat_smile:

mikaelcom commented 3 years ago

Future enhancements are planned and listed in https://github.com/WsdlToPhp/PackageGenerator/issues/233, feel free to add more tasks :wink:

mikaelcom commented 3 years ago

Phar is available at https://github.com/WsdlToPhp/PackageGenerator/releases/tag/feature%2Fissue-124 and docker image is available at https://hub.docker.com/r/mikaelcom/wsdltophp

codecov-io commented 3 years ago

Codecov Report

Merging #234 (bbb27ed) into develop (3938195) will decrease coverage by 0.50%. The diff coverage is 97.28%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #234      +/-   ##
=============================================
- Coverage      98.67%   98.17%   -0.51%     
+ Complexity      1860     1698     -162     
=============================================
  Files            123      107      -16     
  Lines           4315     4007     -308     
=============================================
- Hits            4258     3934     -324     
- Misses            57       73      +16     
Impacted Files Coverage Δ Complexity Δ
src/File/Validation/MinOccursRule.php 25.00% <25.00%> (ø) 4.00 <4.00> (ø)
src/Parser/Wsdl/AbstractTagParser.php 91.37% <85.71%> (-2.38%) 29.00 <29.00> (-1.00)
src/Parser/Wsdl/TagUnion.php 86.84% <88.00%> (-10.39%) 18.00 <18.00> (-2.00)
src/File/ClassMap.php 93.75% <88.23%> (ø) 15.00 <15.00> (+1.00)
src/File/Validation/ItemTypeRule.php 94.11% <88.88%> (-5.89%) 11.00 <11.00> (+1.00) :arrow_down:
src/Parser/Wsdl/TagRestriction.php 92.15% <88.88%> (-7.85%) 23.00 <23.00> (-1.00)
src/File/Operation.php 94.44% <89.28%> (-1.64%) 22.00 <22.00> (ø)
src/Parser/SoapClient/Functions.php 90.90% <90.00%> (-2.85%) 21.00 <21.00> (ø)
src/File/AbstractOperation.php 93.75% <91.42%> (-2.00%) 26.00 <25.00> (ø)
src/Parser/Wsdl/TagList.php 91.66% <91.66%> (-8.34%) 11.00 <11.00> (-1.00)
... and 114 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3938195...bbb27ed. Read the comment docs.

faithfulman18 commented 3 years ago

Will these changes be compatible with PHP 8 as well as 7.4 ? And will they be breaking changes that won't be backwards compatible? Thanks.

mikaelcom commented 3 years ago

Will these changes be compatible with PHP 8 as well as 7.4 ? And will they be breaking changes that won't be backwards compatible? Thanks.

The changes are compatible from PHP >= 7.4, so no more compatible to PHP < 7.4 both for the generator code and the generated code.

You can review the changes in the UPGRADE-4.0 and the 4.0.0 section of the CHANGELOG

sprankhub commented 3 years ago

Thanks a lot for all your work, @mikaelcom! I did not check the code, but tried the phar. This is what I noticed:

  1. When using this new version, which includes strict types, I think the (simple) validation does not make much sense any more. I know I can disable it in the options, but still, I think it should not be added at all any more. I am talking about checking for string even though the parameter type already is string. Having validation for e.g. types inside arrays is still reasonable.
  2. In the generated ClassMap, it would be much nicer to use MyType::class instead of '\\MyType'.
mikaelcom commented 3 years ago

Thanks @sprankhub, I really appreciate your feedback.

As there is always improvements to be made, I decided to create a new issue, https://github.com/WsdlToPhp/PackageGenerator/issues/233, gathering what would come next allowing to release the new version.

So feel free to add more things in this new issue especially your second comment as I already listed the first one.