Skip to content

Invalid typehints for nullable properties with union type #72

@petr-buchyn

Description

@petr-buchyn

Version: 3.5.1

Bug Description

For now for nullable properties this library generates typehint with ?, but this conflicts with PHP8 Union Types.
Generated typehint for union types now looks like ?OneType|OtherType, which is not valid PHP syntax.
Could you fix this for PHP8 please?

Possible Solution

Check PHP version and if it's larger than 8.0 - replace ? for |nullin typehint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions