Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Method "Symfony\Component\HttpKernel\HttpKernelInterface::handle()" will return "Response" as of its next major version.
Steps to reproduce
Proposed resolution
Add the "Response" return type hint.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#10 | 3232082-10.patch | 15.86 KB | daffie |
#10 | interdiff-3232082-6-10.txt | 2.73 KB | daffie |
Comments
Comment #2
daffie CreditAttribution: daffie commentedComment #3
daffie CreditAttribution: daffie commentedThe problem for adding this return type hint is that a lot of contrib modules override the method. See: http://grep.xnddx.ru/search?text=public+function+handle%28&filename=. Maybe we need to wait for D10.0 to commit this patch.
Comment #5
catchLooks like we're returning
NULL
in some places from the test results, should we open another issue to fix those in 9.x?Comment #6
daffie CreditAttribution: daffie commentedThe problem is that to fix the tests you also have to add the return type hinting. The required test changes are in the interdiff patch file and they will fail. Therefor for this and the overrides in contrib, I am moving this to 10.0.
This issue is part of the Symfony 6 stuff and that is all critical.
Comment #7
longwaveFor this to be problematic to contrib, they have to both implement this method *and* extend one of our classes. From a random sample of the results in #3 they either implement HttpKernelInterface directly (in which case they also need to add return types, but it doesn't stop us from doing so beforehand) or are false positives (the method signature is different). I didn't see anything that extends Drupal core code directly.
Therefore moving this back to 9.x for review.
Comment #10
daffie CreditAttribution: daffie commentedFixed the testbot failures.
Comment #12
daffie CreditAttribution: daffie commentedComment #13
longwaveComment #14
alexpottCommitted e147702 and pushed to 9.3.x. Thanks!
Thanks for checking contrib and documenting your checks @longwave.
I think we might need a single CR to collect all the SF6 preparations together?
Comment #16
catchThere's a CR here: https://www.drupal.org/node/3236232
I've added this issue.