Skip to content

Conversation

@veewee
Copy link
Member

@veewee veewee commented Dec 4, 2025

Q A
Type bug / improvement
BC Break yes/no
Fixed issues

Summary

See phpro/soap-client#597

This is not really a BC break, but changes the name for internal elements.
If you use phpro/soap-client, this will result in a change of the generated code - which might be a breaking change in the project that uses soap-client. (That's why we are on version 0.x instead of 1.x I suppose...)

@veewee veewee force-pushed the enhanced-internal-element-type-name-detector branch from ff5ae18 to ea9ebed Compare December 4, 2025 10:37
@Harkonn
Copy link

Harkonn commented Dec 4, 2025

Hi @veewee - i can not apply the patch to php-soap/wsdl-reader 0.28.0. Maybe something is wrong on my end, i have to dig deeper right now.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the internal element name detector to generate more specific type names for inline/anonymous XML schema elements by prefixing them with their root parent type name, addressing issue #597. This improves clarity and prevents naming conflicts when generating code from SOAP WSDL files.

Key Changes:

  • Refactored ElementTypeNameDetector to use root parent context instead of immediate parent for name generation
  • Updated logic to handle various edge cases (Any, ElementRef, named types) where prefixing should not occur
  • Modified ElementSingleConfigurator to properly handle ElementDef and ElementRef types

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

File Description
src/Metadata/Converter/Types/Detector/ElementTypeNameDetector.php Rewrote the type name detection logic to use root parent for prefixing and added validation conditions
src/Metadata/Converter/Types/Visitor/ElementVisitor.php Integrated ElementTypeNameDetector to compute element type names before configuration
src/Metadata/Converter/Types/Configurator/ElementSingleConfigurator.php Updated to handle ElementDef and ElementRef cases when determining inline types
tests/PhpCompatibility/schema*.phpt Updated expected outputs to reflect new naming convention with root parent prefixes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@veewee veewee force-pushed the enhanced-internal-element-type-name-detector branch from ea9ebed to fbd4465 Compare December 4, 2025 10:48
@Harkonn
Copy link

Harkonn commented Dec 4, 2025

The generated patch from github has included test-files, which were missing in the package from packagist :(
Finally I managed to test your code, it works. Tank you :)

@veewee veewee merged commit 49b8e3a into php-soap:main Dec 5, 2025
15 checks passed
@veewee
Copy link
Member Author

veewee commented Dec 5, 2025

Thanks for testing!

(You could also configure composer to use my branch. That way it would just link it through git directly)

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