Skip to content

Fix xsd:language-like simple type generations.#592

Merged
veewee merged 1 commit intophpro:v4.xfrom
veewee:fix-xsd-language-like-simple-types
Oct 23, 2025
Merged

Fix xsd:language-like simple type generations.#592
veewee merged 1 commit intophpro:v4.xfrom
veewee:fix-xsd-language-like-simple-types

Conversation

@veewee
Copy link
Contributor

@veewee veewee commented Oct 23, 2025

Fixes #591

This enhances xsd:language-like type generations from

    /**
     * @var array<int<0,max>, \MyApp\Token>
     */
    private array $elementfilterSprache;

to

    /**
     * @var array<int<0,max>, string>
     */
    private array $elementfilterSprache;

@veewee veewee requested a review from Copilot October 23, 2025 06:35
Copy link
Contributor

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 fixes the type generation for xsd:language-like simple types by ensuring they resolve to their base PHP types (e.g., string) instead of generating unnecessary custom class references.

Key Changes:

  • Added logic to detect simple types with known base types and return the base type directly
  • Added comprehensive test coverage for various type resolution scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Phpro/SoapClient/CodeGenerator/Model/Property.php Added conditional check to return base type for simple types with known base types
test/PhproTest/SoapClient/Unit/CodeGenerator/Model/PropertyTest.php Added new test method with data provider covering type resolution for simple types, namespaced types, and root namespace types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@veewee veewee merged commit 0081710 into phpro:v4.x Oct 23, 2025
6 checks passed
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.

Missing or wrong type for xs:language

1 participant