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

Fix Union Array type StaticTypeMapper to string #2646

Merged
merged 1 commit into from
Jan 11, 2020

Conversation

TomasVotruba
Copy link
Member

Closes #2627

@TomasVotruba TomasVotruba marked this pull request as ready for review January 11, 2020 23:50
@TomasVotruba
Copy link
Member Author

TomasVotruba commented Jan 11, 2020

@gnutix This one was tricky to resolve. I used new branch for easier work and so the traditional syntax was used. For the PHPStan syntax, you'd have to implement optional parameter to prefer that everywhere.

To the issue: The problem is that PHPStan and php-parser see this content in different ways:

int[]|string[]

For one it is array of union types, something like (int|string)[]
for the other it's union type of array, something like int[]|string[]

We'll need refactor this whole converting system, to handle deep nested conversion, and also come up with some simple testing idea, that will cover these type transformations.

@TomasVotruba TomasVotruba merged commit 5d71630 into master Jan 11, 2020
@TomasVotruba TomasVotruba deleted the fix-var-const-unions branch January 11, 2020 23:53
TomasVotruba added a commit that referenced this pull request Jul 9, 2022
rectorphp/rector-src@fba410b [StrictTypes] Add MethodCall/StaticCall to ExclusiveNativeCallLikeReturnMatcher (#2646)
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.

1 participant