Skip to content
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

Invalid getter and annotation for nullable property #312

Closed
velorb opened this issue Jun 14, 2024 · 2 comments · Fixed by #313
Closed

Invalid getter and annotation for nullable property #312

velorb opened this issue Jun 14, 2024 · 2 comments · Fixed by #313
Assignees
Labels

Comments

@velorb
Copy link

velorb commented Jun 14, 2024

Describe the bug
Getter with nullable property has invalid return type. It happens when minOccurs="1" maxOccurs="1"

To Reproduce

            <s:complexType name="Test">
                <s:sequence>
                    <s:element minOccurs="1" maxOccurs="1" name="test" nillable="true" type="s:dateTime" />
                </s:sequence>
            </s:complexType>
     * Get test value
     * @return string
     */
    public function getTest(): string
    {
        return $this->test;
    }

Expected behavior

     * Get test value
     * @return string|null
     */
    public function getTest(): ?string
    {
        return $this->test;
    }
@velorb velorb added the bug label Jun 14, 2024
mikaelcom added a commit that referenced this issue Jun 17, 2024
@mikaelcom mikaelcom linked a pull request Jun 17, 2024 that will close this issue
@mikaelcom
Copy link
Member

Please try generator branch https://github.com/WsdlToPhp/PackageGenerator/tree/feature/issue-312 to validate the bug fix

@velorb
Copy link
Author

velorb commented Jun 17, 2024

it looks good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants