Skip to content

Conversation

@aazsamir
Copy link
Contributor

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 aazsamir force-pushed the feat/mapper-unions-support branch from 3eb8af3 to 588df27 Compare November 18, 2025 20:59
@innocenzi innocenzi changed the title feat(mapper): support unions feat(mapper): support union types in docblocks Nov 19, 2025
@brendt brendt marked this pull request as draft November 22, 2025 05:55
@brendt
Copy link
Member

brendt commented Nov 22, 2025

Looks promising!

@aazsamir aazsamir force-pushed the feat/mapper-unions-support branch from 588df27 to eb5fe70 Compare November 22, 2025 12:03
@brendt
Copy link
Member

brendt commented Dec 12, 2025

@aazsamir I'm sorry for being very late reviewing this PR :( Because of that, there's now a new feature (in 3.x) that has quiet the impact on this PR: #1791

Unfortunately I won't be able to merge this unless it's being refactored and targeted towards 3.x. Sorry for not getting to this earlier, I really appreciate the effort you put into it!

Let me know if I can be of any help.

@brendt brendt closed this Dec 12, 2025
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.

2 participants