Problem/Motivation

In #3029197: [symfony 5] Class implements "Symfony\Component\DependencyInjection\ResettableContainerInterface" that is deprecated since Symfony 4.2, use "Symfony\Contracts\Service\ResetInterface" instead we made Drupal\Component\DependencyInjection\Container not implement Symfony\Component\DependencyInjection\ResettableContainerInterface anymore as that was deprecated in Symfony 4.2. However the replacement Symfony\Contracts\Service\ResetInterface was not yet added in Symfony 3. Using the independent Symfony contracts package was not possible due to PHP version requirements.

Proposed resolution

Make Drupal\Component\DependencyInjection\Container implement Symfony\Contracts\Service\ResetInterface once Drupal depends on at least Symfony 4.

Remaining tasks

Postponed until at least the Symfony 4 updates happens.

User interface changes

None.

API changes

Drupal\Component\DependencyInjection\Container will implement Symfony\Contracts\Service\ResetInterface.

Data model changes

None.

Release notes snippet

N/A

Comments

Gábor Hojtsy created an issue. See original summary.

Version: 9.x-dev » 9.0.x-dev

The 9.0.x branch will open for development soon, and the placeholder 9.x branch should no longer be used. Only issues that require a new major version should be filed against 9.0.x (for example, removing deprecated code or updating dependency major versions). New developments and disruptive changes that are allowed in a minor version should be filed against 8.9.x, and significant new features will be moved to 9.1.x at committer discretion. For more information see the Allowed changes during the Drupal 8 and 9 release cycles and the Drupal 9.0.0 release plan.

mikelutz’s picture

Status: Postponed » Active

reactivating

mikelutz’s picture

Status: Active » Needs review
StatusFileSize
new1.47 KB

Here we go. Added symfony/service-contracts as an explicit dependency, but we already have it as it is a dependency of symfony dependency injection anyway, so no need to update the lock file or scaffolds as nothing changes.

Status: Needs review » Needs work

The last submitted patch, 4: 3032605-4.drupal.patch, failed testing. View results

mikelutz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.47 KB
new608 bytes

Lets try this again...

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Seems simple enough.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Actually this @todo needs removing

 * @todo Implement Symfony\Contracts\Service\ResetInterface once Symfony 4
 *   is being used. See https://www.drupal.org/project/drupal/issues/3032605
mikelutz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.71 KB
new669 bytes

Whoops, good catch, thanks!

mikelutz’s picture

martin107’s picture

Status: Needs review » Reviewed & tested by the community

a) All the reasoning behind this issue, seems sound.
b) All the work issues have been resolved.
c) There are no additional coding standard errors in the test artefacts.

LGTM

  • catch committed d105f45 on 9.1.x
    Issue #3032605 by mikelutz, Gábor Hojtsy, longwave, martin107: [symfony...

  • catch committed d003c38 on 9.0.x
    Issue #3032605 by mikelutz, Gábor Hojtsy, longwave, martin107: [symfony...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed d105f45 and pushed to 9.1.x, cherry-picked to 9.0.x. Thanks!

Status: Fixed » Closed (fixed)

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