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
Comments
Comment #2
alexpottComment #3
nicxvan commentedThis also affects:
ddev unit core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.phpfails with: