Rule Rector\ClassMethod\AddArrayReturnDocTypeRector could not process files#3361
Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom May 12, 2020
Merged
Rule Rector\ClassMethod\AddArrayReturnDocTypeRector could not process files#3361TomasVotruba merged 1 commit intorectorphp:masterfrom
TomasVotruba merged 1 commit intorectorphp:masterfrom
Conversation
Member
|
Could you provide minimal code of your this crashes on? |
Member
|
Mergin as fix. The failing code would still be great |
TomasVotruba
added a commit
that referenced
this pull request
Feb 8, 2023
rectorphp/rector-src@5fc8c1a Replace ParametersAcceptorSelector::selectSingle() with ParametersAcceptorSelectorVariantsWrapper::select() when possible (#3361)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I'm in over my head on this one, as I don't really understand what the code is trying to do in that part. But I get errors like:
The function is being called on
$phpDocInfo, which can be null. It is declared in the docblock as being an object of typePhpDocInfo, but it seems that's not always true (in my code at least).This change is not the right solution! It fixed the processing errors. But it still is not correctly recognizing the classes being added to the docblock, as they show up as long names, even when both 'auto_import_names' and 'import_doc_blocks' are set to true.
I'm not going to use this rector, as it also changes
array<int, Example>toExample[], but I wanted to leave this here, as it is throwing a lot of errors, and at first sight it seemed quite easy to spot the problem. I'm not sure how to proceed. I'm going to look into some other rectors, where I have similar processing problems.