Problem/Motivation

Trying to follow the BC guidelines for deprecating LocaleProjectStorageInterface and the services associated:

  locale.project:
    class: Drupal\locale\LocaleProjectStorage
    deprecated: The "%service_id%" service is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the 'Drupal\locale\LocaleProjectRepository' service instead.See https://www.drupal.org/node/3037033
  Drupal\locale\LocaleProjectStorageInterface:
    alias: 'locale.project'
    deprecated: The "%alias_id%" service is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the 'Drupal\locale\LocaleProjectRepository' service instead.See https://www.drupal.org/node/3037033

Results in deprecation messages being thrown even when the service and classes are not loaded.

@alexpott tracked it down to how \Symfony\Component\DependencyInjection\Compiler\RegisterAutoconfigureAttributesPass::process and \Symfony\Component\DependencyInjection\Compiler\AutowireAsDecoratorPass::process use reflection.

Found in #3037031: Convert locale.compare.inc to a service

Steps to reproduce

Pull down the MR https://git.drupalcode.org/project/drupal/-/merge_requests/15655 in the referenced issue: add

@trigger_error('The ' . __NAMESPACE__ . '\LocaleProjectStorageInterface is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Instead, use \Drupal\locale\LocaleProjectRepository. See https://www.drupal.org/node/3037033', E_USER_DEPRECATED);

to LocaleProjectStorageInterface

run ddev unit core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php

Get:

Configuration: /var/www/html/core/phpunit.xml
D                                                                   1 / 1 (100%)
Time: 00:04.311, Memory: 10.00 MB
1 test triggered 1 deprecation:
1) /var/www/html/core/modules/locale/src/LocaleProjectStorageInterface.php:5
The Drupal\locale\LocaleProjectStorageInterface is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Instead, use \Drupal\locale\LocaleProjectRepository. See https://www.drupal.org/node/3037033
Triggered by:
* Drupal\Tests\locale\Kernel\LocaleUpdateTest::testUpdateProjects
  /var/www/html/core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php:30

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

nicxvan created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
nicxvan’s picture

This also affects:

  Drupal\locale\LocaleProjectStorageInterface:
    alias: '@locale.project'
    deprecated: The "%alias_id%" service is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use the 'Drupal\locale\LocaleProjectRepository' service instead.See https://www.drupal.org/node/3037033

ddev unit core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php fails with:

Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
     'Drupal\locale\LocaleDefaultConfigStorage' => 'locale.default.config.storage',
     'Drupal\locale\LocaleConfigManager' => 'locale.config_manager',
     'Drupal\locale\StringStorageInterface' => 'locale.storage',
-    'Drupal\locale\LocaleProjectStorageInterface' => 'locale.project',
     'Drupal\locale\PluralFormulaInterface' => 'locale.plural.formula',
     'Drupal\language\LanguageNegotiatorInterface' => 'language_negotiator',
     'Drupal\language\Config\LanguageConfigFactoryOverrideInterface' => 'language.config_factory_override',