phpstan-doctrine
phpstan-doctrine copied to clipboard
OtherMethodQueryBuilderParser: prevent broken type infering with partial analysis
Currently, when a file is not among "analysed files" (which is any file not listed in partial analysis), every method body is stripped by CleaningParser. Due to that OtherMethodQueryBuilderParser cannot determine what is happening to the QueryBuilder there and results in mixed
. This results in nasty:
-
partial analysis:
mixed
returned -
full analysis:
list<Entity>
returned
Due to the nature of this feature (affecting only methods returning QueryBuilder) I think it is safe to remove the CleaningParser even with this improvement.