tempest-framework icon indicating copy to clipboard operation
tempest-framework copied to clipboard

feat(mapper): support union types in docblocks

Open aazsamir opened this issue 2 months ago • 1 comments

This pull request adds support for union types along with partially-understanding types defined in docblock.

class StoreRequest {
    /** @var string|string[] */
    public string|array $tags;
}

mixed type is also supported

class StoreRequest {
    /** @var string|mixed[] */
    public string|array $tags;
}

This means that it is now also supported.

class StoreRequest {
    /** $var string[] */
    public array $tags;
}

There are still a few edge cases to resolve, but I would say this is MVP.

aazsamir avatar Nov 11 '25 23:11 aazsamir

Looks promising!

brendt avatar Nov 22 '25 05:11 brendt