-
-
Notifications
You must be signed in to change notification settings - Fork 2
Respect xsi:type information better #39
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
Conversation
e518f39 to
b5648d4
Compare
b5648d4 to
07e34a2
Compare
722bca1 to
cbe86e3
Compare
There was a problem hiding this 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 improves the handling of xsi:type information in SOAP encoding/decoding by better supporting type detection and encoding. The changes centralize xsi:type logic, introduce new encoders for better type handling, and add comprehensive test coverage.
- Introduces new encoders (
XsiTypeEncoder,MatchingValueEncoder,FixedIsoEncoder) for better xsi:type handling - Refactors xsi:type detection logic from
ElementValueBuildertoXsiAttributeBuilderfor better centralization - Adds comprehensive test cases to verify xsi:type encoding/decoding behavior
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/PhpCompatibility/Implied/ImpliedSchema015Test.php | New test for xsi:type handling with class-based objects |
| tests/PhpCompatibility/Implied/ImpliedSchema014Test.php | New test for xsi:type handling with stdClass objects |
| tests/PhpCompatibility/Implied/ImpliedSchema012Test.php | Updates expected XML to use correct xsi:type |
| tests/PhpCompatibility/Implied/ImpliedSchema011Test.php | Updates expected XML to use correct xsi:type |
| tests/PhpCompatibility/Implied/ImpliedSchema010Test.php | Updates expected XML to use correct xsi:type |
| tests/PhpCompatibility/Implied/ImpliedSchema009Test.php | Updates expected XML to use correct xsi:type |
| tests/PhpCompatibility/AbstractCompatibilityTests.php | Adds debug statement for testing |
| src/Xml/Writer/XsiAttributeBuilder.php | Major refactor to centralize xsi:type logic |
| src/Xml/Writer/ElementValueBuilder.php | Removes xsi:type logic and delegates to XsiAttributeBuilder |
| src/Xml/Reader/ElementValueReader.php | Removes xsi:type detection logic |
| src/TypeInference/XsiTypeDetector.php | Refactors to separate type detection from encoder detection |
| src/EncoderRegistry.php | Removes OptionalElementEncoder wrapper and adds new helper methods |
| src/Encoder/XsiTypeEncoder.php | New encoder specifically for handling xsi:type encoding/decoding |
| src/Encoder/SoapEnc/SoapObjectEncoder.php | Updates to use centralized xsi:type logic |
| src/Encoder/SoapEnc/SoapArrayEncoder.php | Updates to use centralized xsi:type logic |
| src/Encoder/SoapEnc/ApacheMapEncoder.php | Updates to use centralized xsi:type logic |
| src/Encoder/SimpleType/EncoderDetector.php | Integrates XsiTypeEncoder into simple type detection |
| src/Encoder/ObjectEncoder.php | Updates to use centralized xsi:type logic |
| src/Encoder/MatchingValueEncoder.php | New encoder for value-based encoder selection |
| src/Encoder/FixedIsoEncoder.php | New encoder for fixed ISO transformations |
| src/Encoder/EncoderDetector.php | Integrates XsiTypeEncoder into encoder detection |
| examples/encoders/simpleType/anyType-with-xsi-info.php | Updates to use new centralized API |
| examples/encoders/complexType/matching-value.php | New example demonstrating MatchingValueEncoder usage |
| composer.json | Updates dependency version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cbe86e3 to
3e44681
Compare
Summary
This PR adds better support for encoding and decoding
xsi:typeinformation.This PR improves the handling of xsi:type information in SOAP encoding/decoding by better supporting type detection and encoding. The changes centralize xsi:type logic, introduce new encoders for better type handling, and add comprehensive test coverage.
Object:
Transcodes to:
For XSD:
With encoder configuration: