Closed (fixed)
Project:
Drupal core
Version:
11.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Dec 2023 at 10:54 UTC
Updated:
30 Jun 2025 at 04:33 UTC
Jump to comment: Most recent
Comments
Comment #2
longwaveComment #3
longwaveNeedless to say this is for 11.x only.
Comment #5
spokjeUnhappy PHPStan
Comment #6
longwaveHm, maybe the debug class loader isn't working like I thought, because we should have been notified already about these subclasses?
Comment #7
spokjeNot sure I follow.
In the MR we added return types where none where there before, now PHPStan complains some sub-classes have defined types that aren't covariant with the newly defined ones.
How could we be warned before we added the return types on the "super" classes?
Comment #8
longwaveRe #7 e.g.
AllowedValuesConstraintValidator::validate()extends a Symfony validator that was tagged@return voidin Symfony 6. But I guess if we have no test coverage of this, then we won't trigger the deprecation.But then what about
SupernovaGenerator::setContext(), which is part of a test - wonder if this is just because the inheritance chain is more complicated, but ultimatelysetContext()belongs to a Symfony interface method that was also tagged@return void.Comment #9
smustgrave commentedWasn't sure how best to find others.
Did a search for phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn and all instances have been removed in core. Tests are green so leaning on that.
This seems like a small enough change to mark without having to wait a week.
Comment #11
quietone commentedRebase. Only conflict was in DrupalKernel.php and it was straightforward to fix.
Comment #12
gábor hojtsyComment #13
alexpottI'm not too concerned about missing some - things will crash if we do and we can fix.
Committed f4167b8 and pushed to 11.x. Thanks!
Comment #17
quietone commentedUpdate version to the branch this applies to.