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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

daffie created an issue. See original summary.

daffie’s picture

Status: Active » Needs review
FileSize
624 bytes

I could not find any instances where the method was overridden in contrib. See: http://grep.xnddx.ru/search?text=public+function+getController%28Request....

daffie’s picture

"false" in lowercase is not allowed. Changed it to uppercase.

longwave’s picture

Version: 9.3.x-dev » 10.0.x-dev

Union types are PHP 8 territory.

Praveen Saini’s picture

Status: Needs review » Reviewed & tested by the community

Nice addition. Works good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Postponed

10.x is not yet open for commits. Going to postpone this so no one commits this to 9.x.y accidentally.

alexpott’s picture

There 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.

longwave’s picture

Status: Postponed » Reviewed & tested by the community

This is OK for 10.0.x now.

  • catch committed 01cb9d7 on 10.0.x
    Issue #3236243 by daffie, longwave, alexpott: [Symfony 6] Add "callable|...
catch’s picture

Status: Reviewed & tested by the community » Fixed

I 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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.