[AddArrayReturnDocTypeRector] Allow mixed[] and iterable<mixed> in place of Rector's setting wrong infered types#2630
Merged
TomasVotruba merged 7 commits intorectorphp:masterfrom Jan 18, 2020
Conversation
…peRector/fix-iterable-mixed
Contributor
Author
|
Do you need anything else to merge this PR ? IMHO, it's ready. |
Member
|
This is hard to review. It seems there are 2 mixed changes, skipping iterable and skipping mixed. |
Contributor
Author
|
It touches exactly the same condition, so I did them both at once indeed. Would be a pain for me to separate them in two PRs. They are essentially the same things : allowing mixed for an array ( I made the fixtures more explicit. Should be easier to read the diff. |
TomasVotruba
approved these changes
Jan 18, 2020
Member
I just got into this. It it easier to read, thanks 👍 |
TomasVotruba
added a commit
that referenced
this pull request
Jul 4, 2022
rectorphp/rector-src@9ab8ce0 [Core] Return early NodeTraverser::STOP_TRAVERSAL on referenced is true on ParamAnalyzer (#2630)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this fix, it changes the return phpdoc into stuff like
@return int[][]|int[][][]|mixed[], which is a mess to read and is plain wrong (a correct one could be@return array<int|int[]>orarray<int|array<int>>orint[]|int[][](though I don't like that multiple[]syntax, hard to read IMO).