Problem/Motivation

interface DrupalKernelInterface extends HttpKernelInterface, ContainerAwareInterface {

but ContainerAwareInterface is deprecated in Symfony 6.4 and removed from Symfony 7.0.

However, it turns out that DrupalKernel::setContainer() is not even called any more.

Steps to reproduce

Proposed resolution

Remove the interface, setContainer() method, and a related outdated code block.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3424177

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

DrupalKernel::initializeContainer() does this:

    // If we haven't booted yet but there is a container, then we're asked to
    // boot the container injected via setContainer().
    // @see \Drupal\KernelTests\KernelTestBase::setUp()
    if (isset($this->container) && !$this->booted) {
      $container = $this->container;
    }

but KernelTestBase::setUp() hasn't called setContainer() since 2017: #2880911: Remove unused KernelTestBase::getCompiledContainerBuilder()

Maybe this is just dead code?

longwave’s picture

Issue summary: View changes

Looks like this is no longer useful.

andypost’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

I think it's good clean-up of deadcode but interface change needs CR

longwave’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

Added https://www.drupal.org/node/3424376 though I think it is super unlikely anyone will be affected by this, it was only added for KernelTestBase and is unused now for over six years.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Thank you! Looks nothing to add)

  • catch committed a6ba33b2 on 11.x
    Issue #3424177 by longwave, andypost: Remove ContainerAwareInterface...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

longwave’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Fixed » Reviewed & tested by the community

As dead code IMHO this can go back to 10.3.x.

catch’s picture

Status: Reviewed & tested by the community » Fixed

It could if it cherry-picked, but it doesn't - and didn't seem worth spending the effort to backport it.

quietone’s picture

Version: 10.3.x-dev » 11.x-dev

This was only fixed in 11.x

And published the CR

Status: Fixed » Closed (fixed)

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