phpstan-doctrine icon indicating copy to clipboard operation
phpstan-doctrine copied to clipboard

OtherMethodQueryBuilderParser: prevent broken type infering with partial analysis

Open janedbal opened this issue 1 year ago • 0 comments

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.

janedbal avatar Dec 06 '23 11:12 janedbal