Enhanced internal element name detector#52
Conversation
ff5ae18 to
ea9ebed
Compare
|
Hi @veewee - i can not apply the patch to |
There was a problem hiding this comment.
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
ElementTypeNameDetectorto 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
ElementSingleConfiguratorto 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.
ea9ebed to
fbd4465
Compare
|
The generated patch from github has included test-files, which were missing in the package from packagist :( |
|
Thanks for testing! (You could also configure composer to use my branch. That way it would just link it through git directly) |
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...)