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\Controller\ControllerResolverInterface::getController()" will return "callable|false" as of its next major version. Doing the same in implementation "Drupal\Core\Controller\ControllerResolver" will be required when upgrading.
Steps to reproduce
Proposed resolution
Add the "callable|false" return type hint.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#3 | 3236243-3.patch | 624 bytes | daffie |
#3 | interdiff-3236243-2-3.txt | 640 bytes | daffie |
Comments
Comment #2
daffie CreditAttribution: daffie commentedI could not find any instances where the method was overridden in contrib. See: http://grep.xnddx.ru/search?text=public+function+getController%28Request....
Comment #3
daffie CreditAttribution: daffie commented"false" in lowercase is not allowed. Changed it to uppercase.
Comment #4
longwaveUnion types are PHP 8 territory.
Comment #5
Praveen Saini CreditAttribution: Praveen Saini as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedNice addition. Works good to me.
Comment #6
alexpott10.x is not yet open for commits. Going to postpone this so no one commits this to 9.x.y accidentally.
Comment #7
alexpottThere is the option of polyfilling the method in Drupal 9. So we use a different signature for PHP 7 and PHP 8. So we can make D9 Symfony 6 compatible on PHP 8 if we want.
Comment #8
longwaveThis is OK for 10.0.x now.
Comment #10
catchI don't think we need to polyfill here - contrib can update against Drupal 9, and the 10.x branch is open.
Committed/pushed to 10.0.x, thanks!