Closed (fixed)
Project:
Drupal core
Version:
11.2.x-dev
Component:
comment.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2025 at 08:08 UTC
Updated:
12 Sep 2025 at 11:24 UTC
Jump to comment: Most recent
Comments
Comment #2
chesn0kComment #5
chesn0kComment #6
niklanConfirming that this is an issue with PHPStan 2 (Level 9) when a controller is extended, e.g., for decorating purposes or any other.
This example will lead to an error:
But it never returns a response. The proposed solution fixes it. Also, the documentation for the return type implies that it is always an array; it does not specify when it is possible to get a
RedirectResponse.Comment #7
catchThis looks like either copypasta or cruft left over from a refactor - other methods in the class return redirects.
Committed/pushed to 11.x, thanks!
Comment #11
catch